1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 17:49:45 +02:00
audacity/lib-src/twolame/doc/html/twolame.1.html

477 lines
9.7 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.1.2" />
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<link rel="stylesheet" href="./twolame-manpage.css" type="text/css" />
<link rel="stylesheet" href="./twolame-quirks.css" type="text/css" />
<title>TWOLAME(1)</title>
</head>
<body>
<div id="header">
<h1>
TWOLAME(1) Manual Page
</h1>
<h2>NAME</h2>
<div class="sectionbody">
<p>twolame -
an optimised MPEG Audio Layer 2 (MP2) encoder
</p>
</div>
</div>
<h2>SYNOPSIS</h2>
<div class="sectionbody">
<p><em>twolame</em> [options] &lt;infile&gt; [outfile]</p>
</div>
<h2>DESCRIPTION</h2>
<div class="sectionbody">
<p>TwoLAME is an optimised MPEG Audio Layer 2 (MP2) encoder based on tooLAME by
Mike Cheng, which in turn is based upon the ISO dist10 code and portions of
LAME. Encoding is performed by the libtwolame library backend.</p>
</div>
<h2>OPTIONS</h2>
<div class="sectionbody">
<h3>Input File</h3>
<p>twolame uses libsndfile for reading the input sound file, so
the input file can be in any format supported by libsndfile.
To read raw PCM audio from STDIN, then use - as the input filename.</p>
<h3>Output File</h3>
<p>If no output filename is specified, then suffix of the input filename
is automatically changed to .mp2. To write the encoded audio to STDOUT
then use - as the output filename.</p>
<h3>Input Options</h3>
<dl>
<dt>
-r, --raw-input
</dt>
<dd>
<p>
Specifies that input is raw signed PCM audio.
If audio is stereo, than audio samples are interleaved
between the two channels.
</p>
</dd>
<dt>
-x, --byte-swap
</dt>
<dd>
<p>
Force byte-swapping of the input. Endian detection is performed
automatically by libsndfile, so this option shouldn't
normally be needed.
</p>
</dd>
<dt>
-s, --samplerate &lt;int&gt;
</dt>
<dd>
<p>
If inputting raw PCM sound, you must specify the sample rate of
the audio in Hz.
Valid sample rates: 16000, 22050, 24000, 32000, 44100, 48000Hz.
Default sample rate is 44100Hz.
</p>
</dd>
<dt>
--samplesize &lt;int&gt;
</dt>
<dd>
<p>
Specifies the sample size (in bits) of the raw PCM audio.
Valid sample sizes: 8, 16, 24, 32.
Default sample size is 16-bit.
</p>
</dd>
<dt>
-N, --channels &lt;int&gt;
</dt>
<dd>
<p>
If inputting raw PCM sound, you must specify the number of channels
in the input audio. Default number of channels is 2.
</p>
</dd>
<dt>
-g, --swap-channels
</dt>
<dd>
<p>
Swap the Left and Right channels of a stereo input file.
</p>
</dd>
<dt>
--scale &lt;float&gt;
</dt>
<dd>
<p>
Scale the input audio prior to encoding.
All of the input audio is multiplied by specified value.
Value between 0 and 1 will reduce the audio gain, and a value
above 1 will increase the gain of the audio.
</p>
</dd>
<dt>
--scale-l &lt;float&gt;
</dt>
<dd>
<p>
Same as --scale, but only affects the left channel.
</p>
</dd>
<dt>
--scale-r &lt;float&gt;
</dt>
<dd>
<p>
Same as --scale, but only affects the right channel.
</p>
</dd>
</dl>
<h3>Output Options</h3>
<dl>
<dt>
-m, --mode &lt;char&gt;
</dt>
<dd>
<p>
Choose the mode of the resulting audio. Default is auto.
</p>
<ul>
<li>
<p>
"a" auto - choose mode automatically based on the input
</p>
</li>
<li>
<p>
"s" stereo
</p>
</li>
<li>
<p>
"d" dual channel
</p>
</li>
<li>
<p>
"j" joint stereo
</p>
</li>
<li>
<p>
"m" mono
</p>
</li>
</ul>
</dd>
<dt>
-a, --downmix
</dt>
<dd>
<p>
If the input file is stereo then, downmix the left and right
input channels into a single mono channel.
</p>
</dd>
<dt>
-b, --bitrate &lt;int&gt;
</dt>
<dd>
<p>
Sets the total bitrate (in kbps) for the output file.
The default bitrate depends on the number of
input channels and samplerate.
</p>
<div class="literalblock">
<div class="content">
<pre><tt>------------------------------
Sample Rate Mono Stereo
------------------------------
48000 96 192
44100 96 192
32000 80 160
24000 48 96
22050 48 96
16000 32 64
------------------------------</tt></pre>
</div></div>
</dd>
<dt>
-P, --psyc-mode &lt;int&gt;
</dt>
<dd>
<p>
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 <em>psycho</em> for a full description of
each of the models available.
Default model is 3.
</p>
</dd>
<dt>
-v, --vbr
</dt>
<dd>
<p>
Enable VBR mode. See <em>vbr</em> documentation file for details.
Default VBR level is 5.0.
</p>
</dd>
<dt>
-v, --vbr-level &lt;float&gt;
</dt>
<dd>
<p>
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 <em>vbr</em> documentation file for details.
</p>
</dd>
<dt>
-l, --ath &lt;float&gt;
</dt>
<dd>
<p>
Set the ATH level. Default level is 0.0.
</p>
</dd>
<dt>
-q, --quick &lt;int&gt;
</dt>
<dd>
<p>
Enable quick mode. Only re-calculate psycho-acoustic
model every specified number of frames.
</p>
</dd>
<dt>
-S, --single-frame
</dt>
<dd>
<p>
Enables single frame mode: only a single frame of MPEG audio
is output and then the program terminates.
</p>
</dd>
</dl>
<h3>Miscellaneous Options</h3>
<dl>
<dt>
-c, --copyright
</dt>
<dd>
<p>
Turn on Copyright flag in output bitstream.
</p>
</dd>
<dt>
-o, --non-original
</dt>
<dd>
<p>
Turn off Original flag in output bitstream.
</p>
</dd>
<dt>
--original
</dt>
<dd>
<p>
Turn on Original flag in output bitstream.
</p>
</dd>
<dt>
-p, --protect
</dt>
<dd>
<p>
Enable CRC error protection in output bitstream.
An extra 16-bit checksum is added to frames.
</p>
</dd>
<dt>
-d, --padding
</dt>
<dd>
<p>
Turn on padding in output bitstream.
</p>
</dd>
<dt>
-R, --reserve &lt;int&gt;
</dt>
<dd>
<p>
Reserve specified number of bits in the each from of the
output bitstream.
</p>
</dd>
<dt>
-e, --deemphasis &lt;char&gt;
</dt>
<dd>
<p>
Set the de-emphasis type (n/c/5). Default is none.
</p>
</dd>
<dt>
-E, --energy
</dt>
<dd>
<p>
Turn on energy level extensions.
</p>
</dd>
</dl>
<h3>Verbosity Options</h3>
<dl>
<dt>
-t, --talkativity &lt;int&gt;
</dt>
<dd>
<p>
Set the amount of information to be displayed on stderr (0 to 10).
Default is 2.
</p>
</dd>
<dt>
--quiet
</dt>
<dd>
<p>
Don't send any messages to stderr, unless there is an error.
(Same as --talkativity=0)
</p>
</dd>
<dt>
--brief
</dt>
<dd>
<p>
Only display a minimal number of messages while encoding.
This setting is quieter than the default talkativity setting.
(Same as --talkativity=1)
</p>
</dd>
<dt>
--verbose
</dt>
<dd>
<p>
Display an increased number of messages on stderr.
This setting is useful to diagnose problems.
(Same as --talkativity=4)
</p>
</dd>
</dl>
</div>
<h2>Return Codes</h2>
<div class="sectionbody">
<p>If encoding completes successfully, then twolame will return 0.
However if encoding is not successful, then it will return one of the following codes.</p>
<ul>
<li>
<p>
1 (No encoding performed)
</p>
</li>
<li>
<p>
2 (Error opening input file)
</p>
</li>
<li>
<p>
4 (Error opening output file)
</p>
</li>
<li>
<p>
6 (Error allocating memory)
</p>
</li>
<li>
<p>
8 (Error in chosen encoding parameters)
</p>
</li>
<li>
<p>
10 (Error reading input audio)
</p>
</li>
<li>
<p>
12 (Error occured while encoding)
</p>
</li>
<li>
<p>
14 (Error writing output audio)
</p>
</li>
</ul>
</div>
<h2>EXAMPLES</h2>
<div class="sectionbody">
<p>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):</p>
<div class="literalblock">
<div class="content">
<pre><tt>twolame sound.wav</tt></pre>
</div></div>
<p>Constant bitrate of 160kbps and joint stereo encoding, saved to file sound_160.mp2:</p>
<div class="literalblock">
<div class="content">
<pre><tt>twolame -b 160 -m j sound.aiff sound_160.mp2</tt></pre>
</div></div>
<p>Encode sound.wav to newfile.mp2 using psycho-acoustic model 2 and encoding
with variable bitrate:</p>
<div class="literalblock">
<div class="content">
<pre><tt>twolame -P 2 -v sound.wav newfile.mp2</tt></pre>
</div></div>
<p>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:</p>
<div class="literalblock">
<div class="content">
<pre><tt>twolame -P 2 -V -5 sound.wav newfile.mp2</tt></pre>
</div></div>
<p>Resample audio file using sox and pipe straight through twolame:</p>
<div class="literalblock">
<div class="content">
<pre><tt>sox sound_11025.aiff -t raw -r 16000 | twolame -r -s 16000 - - &gt; out.mp2</tt></pre>
</div></div>
</div>
<h2>AUTHORS</h2>
<div class="sectionbody">
<p>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.</p>
</div>
<h2>RESOURCES</h2>
<div class="sectionbody">
<p>TwoLAME web site: http://www.twolame.org/</p>
</div>
<h2>SEE ALSO</h2>
<div class="sectionbody">
<p>lame(1), mpg123(1), madplay(1), sox(1)</p>
</div>
<h2>COPYING</h2>
<div class="sectionbody">
<p>Copyright &#169; 2004-2006 The TwoLAME Project. Free use of this software is
granted under the terms of the GNU Lesser General Public License (LGPL).</p>
</div>
<div id="footer">
<div id="footer-text">
Version 0.3.11<br />
Last updated 09-Jan-2008 11:45:19 BST
</div>
</div>
</body>
</html>