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_fileopenstream 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) -> unitopenstream.
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 -> unitopenfile.
Raises Closefile_error if an error occured while trying to close the file.
val get_current_position : mad_file -> intopenfile.type time_unit =
| |
Hours |
| |
Minutes |
| |
Seconds |
| |
Deciseconds |
| |
Centiseconds |
| |
Milliseconds |
val get_current_time : mad_file -> time_unit -> intval decode_frame : mad_file -> stringval decode_frame_float : mad_file -> float array arrayval skip_frame : mad_file -> unitval get_output_format : mad_file -> int * int * intval duration : string -> float