module Mad:Functions for decoding mp3 files using the libmad.sig
..end
Author(s): Samuel Mimram
exception Mad_error of string
exception Read_error of string
exception End_of_stream
exception Openfile_error of string
exception Closefile_error of string
type
mad_file
val openfile : string -> mad_file
Raises Openfile_error
if an error occured while trying to open the file.
val openstream : (int -> string * int) -> mad_file
openstream read_func
opens a stream where read_func n
should be a
function which returns n
bytes of data or less, the second component of
the result being the number of bytes to read in the fist component.read:(int -> string * int) -> seek:(int -> int) -> tell:(unit -> int) -> unit
: openstream
.
ID3 tags are always skipped when using openfile
.
seek
is a callback to seek to an absolute
position on the encoded data, and tell
a callback
to fetch the current position. read
is the reading
callback.
val close : mad_file -> unit
openfile
.
Raises Closefile_error
if an error occured while trying to close the file.
val get_current_position : mad_file -> int
openfile
.type
time_unit =
| |
Hours |
| |
Minutes |
| |
Seconds |
| |
Deciseconds |
| |
Centiseconds |
| |
Milliseconds |
val get_current_time : mad_file -> time_unit -> int
val decode_frame : mad_file -> string
val decode_frame_float : mad_file -> float array array
val skip_frame : mad_file -> unit
val get_output_format : mad_file -> int * int * int
val duration : string -> float