| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 3 |
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 4 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 5 |
<head> |
| 6 |
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
| 7 |
<meta name="generator" content="AsciiDoc 8.6.10" /> |
| 8 |
<title>TWOLAME(1)</title> |
| 9 |
<link rel="stylesheet" href="./asciidoc.css" type="text/css" /> |
| 10 |
|
| 11 |
|
| 12 |
<link rel="stylesheet" href="./twolame.css" type="text/css" /> |
| 13 |
<script type="text/javascript" src="./asciidoc.js"></script> |
| 14 |
<script type="text/javascript"> |
| 15 |
/*<![CDATA[*/ |
| 16 |
asciidoc.install(); |
| 17 |
/*]]>*/ |
| 18 |
</script> |
| 19 |
</head> |
| 20 |
<body class="manpage"> |
| 21 |
<div id="header"> |
| 22 |
<h1> |
| 23 |
TWOLAME(1) Manual Page |
| 24 |
</h1> |
| 25 |
<h2>NAME</h2> |
| 26 |
<div class="sectionbody"> |
| 27 |
<p>twolame - |
| 28 |
an optimised MPEG Audio Layer 2 (MP2) encoder |
| 29 |
</p> |
| 30 |
</div> |
| 31 |
</div> |
| 32 |
<div id="content"> |
| 33 |
<div class="sect1"> |
| 34 |
<h2 id="_synopsis">SYNOPSIS</h2> |
| 35 |
<div class="sectionbody"> |
| 36 |
<div class="paragraph"><p><em>twolame</em> [options] <infile> [outfile]</p></div> |
| 37 |
</div> |
| 38 |
</div> |
| 39 |
<div class="sect1"> |
| 40 |
<h2 id="_description">DESCRIPTION</h2> |
| 41 |
<div class="sectionbody"> |
| 42 |
<div class="paragraph"><p>TwoLAME is an optimised MPEG Audio Layer 2 (MP2) encoder based on tooLAME by |
| 43 |
Mike Cheng, which in turn is based upon the ISO dist10 code and portions of |
| 44 |
LAME. Encoding is performed by the libtwolame library backend.</p></div> |
| 45 |
</div> |
| 46 |
</div> |
| 47 |
<div class="sect1"> |
| 48 |
<h2 id="_options">OPTIONS</h2> |
| 49 |
<div class="sectionbody"> |
| 50 |
<div class="sect2"> |
| 51 |
<h3 id="_input_file">Input File</h3> |
| 52 |
<div class="paragraph"><p>twolame uses libsndfile for reading the input sound file, so |
| 53 |
the input file can be in any format supported by libsndfile. |
| 54 |
To read raw PCM audio from STDIN, then use - as the input filename.</p></div> |
| 55 |
</div> |
| 56 |
<div class="sect2"> |
| 57 |
<h3 id="_output_file">Output File</h3> |
| 58 |
<div class="paragraph"><p>If no output filename is specified, then suffix of the input filename |
| 59 |
is automatically changed to .mp2. To write the encoded audio to STDOUT |
| 60 |
then use - as the output filename.</p></div> |
| 61 |
</div> |
| 62 |
<div class="sect2"> |
| 63 |
<h3 id="_input_options">Input Options</h3> |
| 64 |
<div class="dlist"><dl> |
| 65 |
<dt class="hdlist1"> |
| 66 |
-r, --raw-input |
| 67 |
</dt> |
| 68 |
<dd> |
| 69 |
<p> |
| 70 |
Specifies that input is raw signed PCM audio. |
| 71 |
If audio is stereo, than audio samples are interleaved |
| 72 |
between the two channels. |
| 73 |
</p> |
| 74 |
</dd> |
| 75 |
<dt class="hdlist1"> |
| 76 |
-x, --byte-swap |
| 77 |
</dt> |
| 78 |
<dd> |
| 79 |
<p> |
| 80 |
Force byte-swapping of the input. Endian detection is performed |
| 81 |
automatically by libsndfile, so this option shouldn’t |
| 82 |
normally be needed. |
| 83 |
</p> |
| 84 |
</dd> |
| 85 |
<dt class="hdlist1"> |
| 86 |
-s, --samplerate <int> |
| 87 |
</dt> |
| 88 |
<dd> |
| 89 |
<p> |
| 90 |
If inputting raw PCM sound, you must specify the sample rate of |
| 91 |
the audio in Hz. |
| 92 |
Valid sample rates: 16000, 22050, 24000, 32000, 44100, 48000Hz. |
| 93 |
Default sample rate is 44100Hz. |
| 94 |
</p> |
| 95 |
</dd> |
| 96 |
<dt class="hdlist1"> |
| 97 |
--samplesize <int> |
| 98 |
</dt> |
| 99 |
<dd> |
| 100 |
<p> |
| 101 |
Specifies the sample size (in bits) of the raw PCM audio. |
| 102 |
Valid sample sizes: 8, 16, 24, 32. |
| 103 |
Default sample size is 16-bit. |
| 104 |
</p> |
| 105 |
</dd> |
| 106 |
<dt class="hdlist1"> |
| 107 |
-N, --channels <int> |
| 108 |
</dt> |
| 109 |
<dd> |
| 110 |
<p> |
| 111 |
If inputting raw PCM sound, you must specify the number of channels |
| 112 |
in the input audio. Default number of channels is 2. |
| 113 |
</p> |
| 114 |
</dd> |
| 115 |
<dt class="hdlist1"> |
| 116 |
-g, --swap-channels |
| 117 |
</dt> |
| 118 |
<dd> |
| 119 |
<p> |
| 120 |
Swap the Left and Right channels of a stereo input file. |
| 121 |
</p> |
| 122 |
</dd> |
| 123 |
<dt class="hdlist1"> |
| 124 |
--scale <float> |
| 125 |
</dt> |
| 126 |
<dd> |
| 127 |
<p> |
| 128 |
Scale the input audio prior to encoding. |
| 129 |
All of the input audio is multiplied by specified value. |
| 130 |
Value between 0 and 1 will reduce the audio gain, and a value |
| 131 |
above 1 will increase the gain of the audio. |
| 132 |
</p> |
| 133 |
</dd> |
| 134 |
<dt class="hdlist1"> |
| 135 |
--scale-l <float> |
| 136 |
</dt> |
| 137 |
<dd> |
| 138 |
<p> |
| 139 |
Same as --scale, but only affects the left channel. |
| 140 |
</p> |
| 141 |
</dd> |
| 142 |
<dt class="hdlist1"> |
| 143 |
--scale-r <float> |
| 144 |
</dt> |
| 145 |
<dd> |
| 146 |
<p> |
| 147 |
Same as --scale, but only affects the right channel. |
| 148 |
</p> |
| 149 |
</dd> |
| 150 |
</dl></div> |
| 151 |
</div> |
| 152 |
<div class="sect2"> |
| 153 |
<h3 id="_output_options">Output Options</h3> |
| 154 |
<div class="dlist"><dl> |
| 155 |
<dt class="hdlist1"> |
| 156 |
-m, --mode <char> |
| 157 |
</dt> |
| 158 |
<dd> |
| 159 |
<p> |
| 160 |
Choose the mode of the resulting audio. Default is auto. |
| 161 |
</p> |
| 162 |
<div class="ulist"><ul> |
| 163 |
<li> |
| 164 |
<p> |
| 165 |
"a" auto - choose mode automatically based on the input |
| 166 |
</p> |
| 167 |
</li> |
| 168 |
<li> |
| 169 |
<p> |
| 170 |
"s" stereo |
| 171 |
</p> |
| 172 |
</li> |
| 173 |
<li> |
| 174 |
<p> |
| 175 |
"d" dual channel |
| 176 |
</p> |
| 177 |
</li> |
| 178 |
<li> |
| 179 |
<p> |
| 180 |
"j" joint stereo |
| 181 |
</p> |
| 182 |
</li> |
| 183 |
<li> |
| 184 |
<p> |
| 185 |
"m" mono |
| 186 |
</p> |
| 187 |
</li> |
| 188 |
</ul></div> |
| 189 |
</dd> |
| 190 |
<dt class="hdlist1"> |
| 191 |
-a, --downmix |
| 192 |
</dt> |
| 193 |
<dd> |
| 194 |
<p> |
| 195 |
If the input file is stereo then, downmix the left and right |
| 196 |
input channels into a single mono channel. |
| 197 |
</p> |
| 198 |
</dd> |
| 199 |
<dt class="hdlist1"> |
| 200 |
-b, --bitrate <int> |
| 201 |
</dt> |
| 202 |
<dd> |
| 203 |
<p> |
| 204 |
Sets the total bitrate (in kbps) for the output file. |
| 205 |
The default bitrate depends on the number of |
| 206 |
input channels and samplerate. |
| 207 |
</p> |
| 208 |
<div class="literalblock"> |
| 209 |
<div class="content"> |
| 210 |
<pre><code>------------------------------ |
| 211 |
Sample Rate Mono Stereo |
| 212 |
------------------------------ |
| 213 |
48000 96 192 |
| 214 |
44100 96 192 |
| 215 |
32000 80 160 |
| 216 |
24000 48 96 |
| 217 |
22050 48 96 |
| 218 |
16000 32 64 |
| 219 |
------------------------------</code></pre> |
| 220 |
</div></div> |
| 221 |
</dd> |
| 222 |
<dt class="hdlist1"> |
| 223 |
-P, --psyc-mode <int> |
| 224 |
</dt> |
| 225 |
<dd> |
| 226 |
<p> |
| 227 |
Choose the psycho-acoustic model to use (-1 to 4). |
| 228 |
Model number -1 is turns off psycho-acoustic modelling and |
| 229 |
uses fixed default values instead. |
| 230 |
Please see the file <em>psycho</em> for a full description of |
| 231 |
each of the models available. |
| 232 |
Default model is 3. |
| 233 |
</p> |
| 234 |
</dd> |
| 235 |
<dt class="hdlist1"> |
| 236 |
-v, --vbr |
| 237 |
</dt> |
| 238 |
<dd> |
| 239 |
<p> |
| 240 |
Enable VBR mode. See <em>vbr</em> documentation file for details. |
| 241 |
Default VBR level is 5.0. |
| 242 |
</p> |
| 243 |
</dd> |
| 244 |
<dt class="hdlist1"> |
| 245 |
-V, --vbr-level <float> |
| 246 |
</dt> |
| 247 |
<dd> |
| 248 |
<p> |
| 249 |
Enable VBR mode and set quality level. |
| 250 |
The higher the number the better the quality. |
| 251 |
Maximum range is -50 to 50 but useful range is -10 to 10. |
| 252 |
See <em>vbr</em> documentation file for details. |
| 253 |
</p> |
| 254 |
</dd> |
| 255 |
<dt class="hdlist1"> |
| 256 |
-l, --ath <float> |
| 257 |
</dt> |
| 258 |
<dd> |
| 259 |
<p> |
| 260 |
Set the ATH level. Default level is 0.0. |
| 261 |
</p> |
| 262 |
</dd> |
| 263 |
<dt class="hdlist1"> |
| 264 |
-q, --quick <int> |
| 265 |
</dt> |
| 266 |
<dd> |
| 267 |
<p> |
| 268 |
Enable quick mode. Only re-calculate psycho-acoustic |
| 269 |
model every specified number of frames. |
| 270 |
</p> |
| 271 |
</dd> |
| 272 |
<dt class="hdlist1"> |
| 273 |
-S, --single-frame |
| 274 |
</dt> |
| 275 |
<dd> |
| 276 |
<p> |
| 277 |
Enables single frame mode: only a single frame of MPEG audio |
| 278 |
is output and then the program terminates. |
| 279 |
</p> |
| 280 |
</dd> |
| 281 |
</dl></div> |
| 282 |
</div> |
| 283 |
<div class="sect2"> |
| 284 |
<h3 id="_miscellaneous_options">Miscellaneous Options</h3> |
| 285 |
<div class="dlist"><dl> |
| 286 |
<dt class="hdlist1"> |
| 287 |
-c, --copyright |
| 288 |
</dt> |
| 289 |
<dd> |
| 290 |
<p> |
| 291 |
Turn on Copyright flag in output bitstream. |
| 292 |
</p> |
| 293 |
</dd> |
| 294 |
<dt class="hdlist1"> |
| 295 |
-o, --non-original |
| 296 |
</dt> |
| 297 |
<dd> |
| 298 |
<p> |
| 299 |
Turn off Original flag in output bitstream. |
| 300 |
</p> |
| 301 |
</dd> |
| 302 |
<dt class="hdlist1"> |
| 303 |
--original |
| 304 |
</dt> |
| 305 |
<dd> |
| 306 |
<p> |
| 307 |
Turn on Original flag in output bitstream. |
| 308 |
</p> |
| 309 |
</dd> |
| 310 |
<dt class="hdlist1"> |
| 311 |
-p, --protect |
| 312 |
</dt> |
| 313 |
<dd> |
| 314 |
<p> |
| 315 |
Enable CRC error protection in output bitstream. |
| 316 |
An extra 16-bit checksum is added to frames. |
| 317 |
</p> |
| 318 |
</dd> |
| 319 |
<dt class="hdlist1"> |
| 320 |
-d, --padding |
| 321 |
</dt> |
| 322 |
<dd> |
| 323 |
<p> |
| 324 |
Turn on padding in output bitstream. |
| 325 |
</p> |
| 326 |
</dd> |
| 327 |
<dt class="hdlist1"> |
| 328 |
-R, --reserve <int> |
| 329 |
</dt> |
| 330 |
<dd> |
| 331 |
<p> |
| 332 |
Reserve specified number of bits in the each from of the |
| 333 |
output bitstream. |
| 334 |
</p> |
| 335 |
</dd> |
| 336 |
<dt class="hdlist1"> |
| 337 |
-e, --deemphasis <char> |
| 338 |
</dt> |
| 339 |
<dd> |
| 340 |
<p> |
| 341 |
Set the de-emphasis type (n/c/5). Default is none. |
| 342 |
</p> |
| 343 |
</dd> |
| 344 |
<dt class="hdlist1"> |
| 345 |
-E, --energy |
| 346 |
</dt> |
| 347 |
<dd> |
| 348 |
<p> |
| 349 |
Turn on energy level extensions. |
| 350 |
</p> |
| 351 |
</dd> |
| 352 |
</dl></div> |
| 353 |
</div> |
| 354 |
<div class="sect2"> |
| 355 |
<h3 id="_verbosity_options">Verbosity Options</h3> |
| 356 |
<div class="dlist"><dl> |
| 357 |
<dt class="hdlist1"> |
| 358 |
-t, --talkativity <int> |
| 359 |
</dt> |
| 360 |
<dd> |
| 361 |
<p> |
| 362 |
Set the amount of information to be displayed on stderr (0 to 10). |
| 363 |
Default is 2. |
| 364 |
</p> |
| 365 |
</dd> |
| 366 |
<dt class="hdlist1"> |
| 367 |
--quiet |
| 368 |
</dt> |
| 369 |
<dd> |
| 370 |
<p> |
| 371 |
Don’t send any messages to stderr, unless there is an error. |
| 372 |
(Same as --talkativity=0) |
| 373 |
</p> |
| 374 |
</dd> |
| 375 |
<dt class="hdlist1"> |
| 376 |
--brief |
| 377 |
</dt> |
| 378 |
<dd> |
| 379 |
<p> |
| 380 |
Only display a minimal number of messages while encoding. |
| 381 |
This setting is quieter than the default talkativity setting. |
| 382 |
(Same as --talkativity=1) |
| 383 |
</p> |
| 384 |
</dd> |
| 385 |
<dt class="hdlist1"> |
| 386 |
--verbose |
| 387 |
</dt> |
| 388 |
<dd> |
| 389 |
<p> |
| 390 |
Display an increased number of messages on stderr. |
| 391 |
This setting is useful to diagnose problems. |
| 392 |
(Same as --talkativity=4) |
| 393 |
</p> |
| 394 |
</dd> |
| 395 |
</dl></div> |
| 396 |
</div> |
| 397 |
</div> |
| 398 |
</div> |
| 399 |
<div class="sect1"> |
| 400 |
<h2 id="_return_codes">Return Codes</h2> |
| 401 |
<div class="sectionbody"> |
| 402 |
<div class="paragraph"><p>If encoding completes successfully, then twolame will return 0. |
| 403 |
However if encoding is not successful, then it will return one of the following codes.</p></div> |
| 404 |
<div class="ulist"><ul> |
| 405 |
<li> |
| 406 |
<p> |
| 407 |
1 (No encoding performed) |
| 408 |
</p> |
| 409 |
</li> |
| 410 |
<li> |
| 411 |
<p> |
| 412 |
2 (Error opening input file) |
| 413 |
</p> |
| 414 |
</li> |
| 415 |
<li> |
| 416 |
<p> |
| 417 |
4 (Error opening output file) |
| 418 |
</p> |
| 419 |
</li> |
| 420 |
<li> |
| 421 |
<p> |
| 422 |
6 (Error allocating memory) |
| 423 |
</p> |
| 424 |
</li> |
| 425 |
<li> |
| 426 |
<p> |
| 427 |
8 (Error in chosen encoding parameters) |
| 428 |
</p> |
| 429 |
</li> |
| 430 |
<li> |
| 431 |
<p> |
| 432 |
10 (Error reading input audio) |
| 433 |
</p> |
| 434 |
</li> |
| 435 |
<li> |
| 436 |
<p> |
| 437 |
12 (Error occurred while encoding) |
| 438 |
</p> |
| 439 |
</li> |
| 440 |
<li> |
| 441 |
<p> |
| 442 |
14 (Error writing output audio) |
| 443 |
</p> |
| 444 |
</li> |
| 445 |
</ul></div> |
| 446 |
</div> |
| 447 |
</div> |
| 448 |
<div class="sect1"> |
| 449 |
<h2 id="_examples">EXAMPLES</h2> |
| 450 |
<div class="sectionbody"> |
| 451 |
<div class="paragraph"><p>This will encode sound.wav to sound.mp2 using the default constant bitrate of 192 kbps |
| 452 |
and using the default psycho-acoustic model (model 3):</p></div> |
| 453 |
<div class="literalblock"> |
| 454 |
<div class="content"> |
| 455 |
<pre><code>twolame sound.wav</code></pre> |
| 456 |
</div></div> |
| 457 |
<div class="paragraph"><p>Constant bitrate of 160kbps and joint stereo encoding, saved to file sound_160.mp2:</p></div> |
| 458 |
<div class="literalblock"> |
| 459 |
<div class="content"> |
| 460 |
<pre><code>twolame -b 160 -m j sound.aiff sound_160.mp2</code></pre> |
| 461 |
</div></div> |
| 462 |
<div class="paragraph"><p>Encode sound.wav to newfile.mp2 using psycho-acoustic model 2 and encoding |
| 463 |
with variable bitrate:</p></div> |
| 464 |
<div class="literalblock"> |
| 465 |
<div class="content"> |
| 466 |
<pre><code>twolame -P 2 -v sound.wav newfile.mp2</code></pre> |
| 467 |
</div></div> |
| 468 |
<div class="paragraph"><p>Same as example above, except that the negative value of the "-V" argument |
| 469 |
means that the lower bitrates will be favoured over the higher ones:</p></div> |
| 470 |
<div class="literalblock"> |
| 471 |
<div class="content"> |
| 472 |
<pre><code>twolame -P 2 -V -5 sound.wav newfile.mp2</code></pre> |
| 473 |
</div></div> |
| 474 |
<div class="paragraph"><p>Resample audio file using sox and pipe straight through twolame:</p></div> |
| 475 |
<div class="literalblock"> |
| 476 |
<div class="content"> |
| 477 |
<pre><code>sox sound_11025.aiff -t raw -r 16000 | twolame -r -s 16000 - - > out.mp2</code></pre> |
| 478 |
</div></div> |
| 479 |
</div> |
| 480 |
</div> |
| 481 |
<div class="sect1"> |
| 482 |
<h2 id="_authors">AUTHORS</h2> |
| 483 |
<div class="sectionbody"> |
| 484 |
<div class="paragraph"><p>The twolame frontend was (re)written by Nicholas J Humfrey. |
| 485 |
The libtwolame library is based on toolame by Mike Cheng. |
| 486 |
For a full list of authors, please see the AUTHORS file.</p></div> |
| 487 |
</div> |
| 488 |
</div> |
| 489 |
<div class="sect1"> |
| 490 |
<h2 id="_resources">RESOURCES</h2> |
| 491 |
<div class="sectionbody"> |
| 492 |
<div class="paragraph"><p>TwoLAME web site: <a href="http://www.twolame.org/">http://www.twolame.org/</a></p></div> |
| 493 |
</div> |
| 494 |
</div> |
| 495 |
<div class="sect1"> |
| 496 |
<h2 id="_see_also">SEE ALSO</h2> |
| 497 |
<div class="sectionbody"> |
| 498 |
<div class="paragraph"><p>lame(1), mpg123(1), madplay(1), sox(1)</p></div> |
| 499 |
</div> |
| 500 |
</div> |
| 501 |
<div class="sect1"> |
| 502 |
<h2 id="_copying">COPYING</h2> |
| 503 |
<div class="sectionbody"> |
| 504 |
<div class="paragraph"><p>Copyright © 2004-2018 The TwoLAME Project. Free use of this software is |
| 505 |
granted under the terms of the GNU Lesser General Public License (LGPL).</p></div> |
| 506 |
</div> |
| 507 |
</div> |
| 508 |
</div> |
| 509 |
<div id="footnotes"><hr /></div> |
| 510 |
<div id="footer"> |
| 511 |
<div id="footer-text"> |
| 512 |
Version 0.4.0<br /> |
| 513 |
Last updated |
| 514 |
2019-10-11 17:26:25 BST |
| 515 |
</div> |
| 516 |
</div> |
| 517 |
</body> |
| 518 |
</html> |