|o||"a" auto - choose mode automatically based on the input|
o "s" stereo
o "d" dual channel
o "j" joint stereo
o "m" mono
If the input file is stereo then, downmix the left and right input channels into a single mono channel.
-b, --bitrate <int>
Sets the total bitrate (in kbps) for the output file. The default bitrate depends on the number of input channels and samplerate.
------------------------------ Sample Rate Mono Stereo ------------------------------ 48000 96 192 44100 96 192 32000 80 160 24000 48 96 22050 48 96 16000 32 64 ------------------------------
-P, --psyc-mode <int>
Choose the psycho-acoustic model to use (-1 to 4). Model number -1 is turns off psycho-acoustic modelling and uses fixed default values instead. Please see the file psycho for a full description of each of the models available. Default model is 3.
Enable VBR mode. See vbr documentation file for details. Default VBR level is 5.0.
-V, --vbr-level <float>
Enable VBR mode and set quality level. The higher the number the better the quality. Maximum range is -50 to 50 but useful range is -10 to 10. See vbr documentation file for details.
-l, --ath <float>
Set the ATH level. Default level is 0.0.
-q, --quick <int>
Enable quick mode. Only re-calculate psycho-acoustic model every specified number of frames.
Enables single frame mode: only a single frame of MPEG audio is output and then the program terminates.
-c, --copyrightTurn on Copyright flag in output bitstream.
-o, --non-originalTurn off Original flag in output bitstream.
--originalTurn on Original flag in output bitstream.
-p, --protectEnable CRC error protection in output bitstream. An extra 16-bit checksum is added to frames.
-d, --paddingTurn on padding in output bitstream.
-R, --reserve <int>Reserve specified number of bits in the each from of the output bitstream.
-e, --deemphasis <char>Set the de-emphasis type (n/c/5). Default is none.
-E, --energyTurn on energy level extensions.
-t, --talkativity <int>Set the amount of information to be displayed on stderr (0 to 10). Default is 2.
--quietDont send any messages to stderr, unless there is an error. (Same as --talkativity=0)
--briefOnly display a minimal number of messages while encoding. This setting is quieter than the default talkativity setting. (Same as --talkativity=1)
--verboseDisplay an increased number of messages on stderr. This setting is useful to diagnose problems. (Same as --talkativity=4)
If encoding completes successfully, then twolame will return 0. However if encoding is not successful, then it will return one of the following codes.
o 1 (No encoding performed)
o 2 (Error opening input file)
o 4 (Error opening output file)
o 6 (Error allocating memory)
o 8 (Error in chosen encoding parameters)
o 10 (Error reading input audio)
o 12 (Error occured while encoding)
o 14 (Error writing output audio)
This will encode sound.wav to sound.mp2 using the default constant bitrate of 192 kbps and using the default psycho-acoustic model (model 3):
Constant bitrate of 160kbps and joint stereo encoding, saved to file sound_160.mp2:
twolame -b 160 -m j sound.aiff sound_160.mp2
Encode sound.wav to newfile.mp2 using psycho-acoustic model 2 and encoding with variable bitrate:
twolame -P 2 -v sound.wav newfile.mp2
Same as example above, except that the negative value of the "-V" argument means that the lower bitrates will be favoured over the higher ones:
twolame -P 2 -V -5 sound.wav newfile.mp2
Resample audio file using sox and pipe straight through twolame:
sox sound_11025.aiff -t raw -r 16000 | twolame -r -s 16000 - - > out.mp2
The twolame frontend was (re)written by Nicholas J Humfrey. The libtwolame library is based on toolame by Mike Cheng. For a full list of authors, please see the AUTHORS file.
TwoLAME web site: [blue]http://www.twolame.org/
Copyright © 2004-2006 The TwoLAME Project. Free use of this software is granted under the terms of the GNU Lesser General Public License (LGPL).
Nicholas J Humfrey <email@example.com>Author.