Module Mad
module Mad: sig
.. end
Functions for decoding mp3 files using the libmad.
Author(s): Samuel Mimram
Exceptions
exception Mad_error of string
An error occured with libmad.
exception Read_error of string
An error occured while reading a file.
exception End_of_stream
The end of the mp3 stream was reached.
exception Openfile_error of string
Could not open a file.
exception Closefile_error of string
Could not close a file.
Parameters of the output format
val wav_output_channels : int
Number of channels of the output.
val wav_output_sample_freq : int
Sampling frequency of the output in Hertz.
val wav_output_sample_size : int
Sample size of the output in bits.
val wav_output_big_endian : bool
Are the output samples in big endian?
val wav_output_signed : bool
Are the output samples signed?
Decoding files
type
mad_file
An mp3 file opened for decoding.
val openfile : string -> mad_file
Open an mp3 file.
Raises Openfile_error
if an error occured while trying to open the file.
val close : mad_file -> unit
Close a previously opened mp3 file.
Raises Closefile_error
if an error occured while trying to close the file.
val get_current_position : mad_file -> int
Get the current position (in bytes) of the decoder in the mp3 file.
val decode_frame : mad_file -> string
Decode an mp3 frame.