sig
module Decoder :
sig
type 'a dec
type 'a t
type write = float array array -> unit
type read = int -> string * int
type 'a callbacks
type generic
type info = {
sample_rate : int;
channels : int;
bits_per_sample : int;
total_samples : int64;
md5sum : string;
}
type comments = string * (string * string) list
type state =
[ `Aborted
| `End_of_stream
| `Memory_allocation_error
| `Ogg_error
| `Read_frame
| `Read_metadata
| `Search_for_frame_sync
| `Search_for_metadata
| `Seek_error
| `Uninitialized ]
exception Lost_sync
exception Bad_header
exception Frame_crc_mismatch
exception Unparseable_stream
exception Not_flac
val get_callbacks :
?seek:(int64 -> unit) ->
?tell:(unit -> int64) ->
?length:(unit -> int64) ->
?eof:(unit -> bool) ->
Flac.Decoder.read ->
Flac.Decoder.write -> Flac.Decoder.generic Flac.Decoder.callbacks
val create : 'a Flac.Decoder.callbacks -> 'a Flac.Decoder.dec
val init :
'a Flac.Decoder.dec ->
'a Flac.Decoder.callbacks ->
'a Flac.Decoder.t * Flac.Decoder.info * Flac.Decoder.comments option
val process : 'a Flac.Decoder.t -> 'a Flac.Decoder.callbacks -> unit
val seek :
'a Flac.Decoder.t ->
'a Flac.Decoder.callbacks -> Stdlib.Int64.t -> bool
val flush : 'a Flac.Decoder.t -> 'a Flac.Decoder.callbacks -> bool
val reset : 'a Flac.Decoder.t -> 'a Flac.Decoder.callbacks -> bool
val state :
'a Flac.Decoder.t -> 'a Flac.Decoder.callbacks -> Flac.Decoder.state
val to_s16le : float array array -> string
module File :
sig
type file
type handle = {
fd : Unix.file_descr;
dec : Flac.Decoder.File.file Flac.Decoder.t;
callbacks : Flac.Decoder.File.file Flac.Decoder.callbacks;
info : Flac.Decoder.info;
comments : (string * (string * string) list) option;
}
val create_from_fd :
Flac.Decoder.write -> Unix.file_descr -> Flac.Decoder.File.handle
val create :
Flac.Decoder.write -> string -> Flac.Decoder.File.handle
end
end
module Encoder :
sig
type 'a t
type write = bytes -> unit
type 'a callbacks
type generic
type params = {
channels : int;
bits_per_sample : int;
sample_rate : int;
compression_level : int option;
total_samples : int64 option;
}
type comments = (string * string) list
exception Invalid_data
val get_callbacks :
?seek:(int64 -> unit) ->
?tell:(unit -> int64) ->
Flac.Encoder.write -> Flac.Encoder.generic Flac.Encoder.callbacks
val create :
?comments:Flac.Encoder.comments ->
Flac.Encoder.params -> 'a Flac.Encoder.callbacks -> 'a Flac.Encoder.t
val process :
'a Flac.Encoder.t ->
'a Flac.Encoder.callbacks -> float array array -> unit
val finish : 'a Flac.Encoder.t -> 'a Flac.Encoder.callbacks -> unit
val from_s16le : string -> int -> float array array
module File :
sig
type file
type handle = {
fd : Unix.file_descr;
enc : Flac.Encoder.File.file Flac.Encoder.t;
callbacks : Flac.Encoder.File.file Flac.Encoder.callbacks;
}
val create_from_fd :
?comments:Flac.Encoder.comments ->
Flac.Encoder.params ->
Unix.file_descr -> Flac.Encoder.File.handle
val create :
?comments:Flac.Encoder.comments ->
Flac.Encoder.params -> string -> Flac.Encoder.File.handle
end
end
exception Internal
end