sig
exception Invalid_parameters
exception Invalid_quality
exception Invalid_bitrate
exception Invalid_channels
exception Invalid_sample_freq
exception Could_not_open_file
exception Not_vorbis
exception Bad_header
exception Read_error
exception Internal_fault
exception Hole_in_data
exception Bad_link
exception Version_mismatch
exception Unknown_error
exception Utf8_failure of string
type encoder
type enc_params = {
enc_bitrate : int option;
enc_min_bitrate : int option;
enc_max_bitrate : int option;
enc_quality : float;
enc_channels : int;
enc_sample_freq : int option;
enc_managed : bool;
enc_in_channels : int;
enc_in_sample_freq : int;
enc_in_sample_size : int;
enc_in_big_endian : bool;
}
val set_charset : string -> unit
val create_encoder :
?title:string ->
?artist:string ->
?genre:string ->
?date:string ->
?album:string ->
?tracknum:string ->
?comment:string -> Vorbis.enc_params -> Vorbis.encoder * string
val create_encoder_opt :
string option ->
string option ->
string option ->
string option ->
string option ->
string option ->
string option -> Vorbis.enc_params -> Vorbis.encoder * string
val encode_buffer : Vorbis.encoder -> string -> string
val encode_buffer_part : Vorbis.encoder -> string -> int -> int -> string
type dec_params = { sample_size : int; big_endian : bool; signed : bool; }
type dec_file
val open_dec_file : string -> Vorbis.dec_params -> Vorbis.dec_file
val open_dec_fd : Unix.file_descr -> Vorbis.dec_params -> Vorbis.dec_file
val open_dec_stream :
(int -> string) ->
(unit -> int) ->
(unit -> unit) -> (unit -> int) -> Vorbis.dec_params -> Vorbis.dec_file
val decode : Vorbis.dec_file -> string -> int -> int -> int
val close_dec_file : Vorbis.dec_file -> unit
val encoder_reset :
?title:string ->
?artist:string ->
?genre:string ->
?date:string ->
?album:string ->
?tracknum:string -> ?comment:string -> Vorbis.encoder -> string
val encoder_reset_opt :
string option ->
string option ->
string option ->
string option ->
string option ->
string option -> string option -> Vorbis.encoder -> string
type info = {
vorbis_version : int;
audio_channels : int;
audio_sample_rate : int;
bitrate_maximum : int option;
bitrate_nominal : int option;
bitrate_minimum : int option;
blocksize_0 : int;
blocksize_1 : int;
duration : int;
}
val get_dec_file_bitstream : Vorbis.dec_file -> int
val get_dec_file_comments :
Vorbis.dec_file -> int option -> string * (string * string) array
val get_dec_file_info : Vorbis.dec_file -> Vorbis.info
val get_comments : string -> string * (string * string) array
val get_info : ?duration:bool -> string -> Vorbis.info
val file_size : string -> int
module type Iofile =
sig
type file_descr
type open_flag = O_RDONLY | O_WRONLY | O_RDWR | O_CREAT | O_TRUNC
type file_perm = int
type seek_command = SEEK_SET | SEEK_CUR | SEEK_END
val openfile :
string ->
Vorbis.Iofile.open_flag list ->
Vorbis.Iofile.file_perm -> Vorbis.Iofile.file_descr
val close : Vorbis.Iofile.file_descr -> unit
val read : Vorbis.Iofile.file_descr -> string -> int -> int -> int
val lseek :
Vorbis.Iofile.file_descr -> int -> Vorbis.Iofile.seek_command -> int
end
module Info :
functor (Io : Iofile) ->
sig
val get_comments : string -> string * (string * string) array
val get_info : string -> Vorbis.info
val get_heuristical_info : string -> Vorbis.info
val file_size : string -> int
end
end