module Encoder:sig..end
(* A function to write encoded data *)
let write = (..a function of type write..) in
(* Create the encoding callbacks *)
let callbacks = Flac.Encoder.get_callbacks write in
(* Define the parameters and comments *)
let params = (..a value of type params ..) in
let comments = [("title","FLAC encoding example")] in
(* Create an encoder *)
let enc = Flac.Encoder.create ~comments params callbacks in
(* Encode data *)
let data = (..a value of type float array array.. in
Flac.Encoder.process enc callbacks data ;
(..repeat encoding process..)
(* Close encoder *)
Flac.Encoder.finish enc callbacks
Remarks:
seek callback is given. type 'a t
typewrite =string -> unit
type 'a callbacks
type generic
type params = {
|
channels : |
|
bits_per_sample : |
|
sample_rate : |
|
compression_level : |
|
total_samples : |
typecomments =(string * string) list
exception Invalid_data
val get_callbacks : ?seek:(int64 -> unit) ->
?tell:(unit -> int64) ->
write -> generic callbacksval create : ?comments:comments ->
params -> 'a callbacks -> 'a tval process : 'a t -> 'a callbacks -> float array array -> unitval finish : 'a t -> 'a callbacks -> unitval from_s16le : string -> int -> float array arraymodule File:sig..end