Page
Library
Module
Module type
Parameter
Class
Class type
Source
Lame
Source* Bindings to the lame library to encode mp3 files. * *
Get the lame version number.
Get the lame version number (shorter than get_lame_version
).
Get the lame version number (shorter than get_lame_short_version
).
Get the url of the lame website.
Get the version of the psy model.
Type for lame encoders.
Frame size. All audio frames submitted to the encoder * should have this number of samples per channel.
* Output sample rate in Hz (default: 0, which means LAME picks best value * based on the amount of compression). MPEG only allows: * - MPEG1 (32, 44.1, 48 kHz) * - MPEG2 (16, 22.05, 24 kHz) * - MPEG2.5 (8, 11.025, 12 kHz)
* Internal algorithm selection. True quality is determined by the bitrate * but this variable will effect quality by selecting expensive or cheap * algorithms. The quality is an integer between 0 and 9, where 0=best (very * slow) and 9=worst. More precisely: * - 2: near-best quality, not too slow (recommended) * - 5: good quality, fast * - 7: ok quality, really fast
Compression mode.
VBR (Variable BitRate) mode.
Set the VBR mean birate in kbps. Only used by Vbr_abr
mode.
If true
, enforce the minimal VBR bitrate. Normally it will be violated * for analog silence.
Set the bitrate of compressed data. You can either set this or use * set_compression_ratio
.
A call to init_params
failed for some reason.
Initialize lame's parameters. Should be called before encoding (and after * having set the parameters). Raises Init_params_failed
on error.
Write id3v2 and Xing headers into the front of the bitstream, and set * frame counters and bitrate histogram data to 0. Normally, this is called by * init_params
. You can call this after encode_flush_nogap
.
You should have called init_params
.
A problem occured with psychoacoustics.
This should not have happened. Please report.
encode_buffer_part enc buf ofs smpl
encodes samples
* samples (per channel) of buf
starting at position ofs
.
Same as encode_buffer_part
but with ofs = 0
.
encode_buffer_float_part enc left right ofs smpl
encodes samples
* samples of left
and right
channels starting at position ofs
. * Floats are expected to range over -1;1
.
Same as encode_buffer_float_part
but with ofs = 0
.
val encode_buffer_float_ba :
encoder ->
(float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t ->
(float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t ->
string
Encode a buffer of samples. The samples follow here lame's convention of having floats in the range -32768.,32768.
(yes, this is crazy but that's the way things are).
Flush the PCM buffers, padding with zeros if needed to make a complete * frame. Will also write id3v1 tags (if any) into the bitstream.
Flush the PCM buffers, padding with zeros if needed to make a complete * frame. This function will not write id3v1 tags into the bitstream.
MPEG version.
The MPEG version used by the encoder.
Number of PCM samples buffered, but not yet encoded to mp3 data.