Page
Library
Module
Module type
Parameter
Class
Class type
Source
Mad
Source* Functions for decoding mp3 files using the libmad. * *
An error occured with libmad.
An error occured while reading a file.
The end of the mp3 stream was reached.
Could not open a file.
Could not close a file.
An mp3 file opened for decoding.
type frame_format = {
layer : mpeg_layer;
mode : channel_mode;
emphasis : emphasis;
bitrate : int;
samplerate : int;
channels : int;
samples_per_channel : int;
original : bool;
copyright : bool;
private_bit : bool;
}
Type for abstract reader.
* 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.
* Skip ID3 tags that may be present at * the beginning of a stream. This function * may be used to a mp3 file opened using 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.
* Get the current position (in bytes) of the decoder in the mp3 file which * should have been opened with openfile
.
* Get the current time position (in the given unit) of the decoder.
Decode an mp3 frame. * Returned data in interleaved when * there are two channels, and mono data * when there is only one.
val decode_frame_float_ba :
mad_file ->
(float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t array
Skip one frame. The current time/position is * updated but the frame is not decoded.
Compute the duration of a file, in seconds. * Never raises any exception, but returns 0. in case of error.