File: twolame.1.txt

package info (click to toggle)
twolame 0.3.13-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,800 kB
  • sloc: sh: 11,099; ansic: 9,332; perl: 286; makefile: 171
file content (264 lines) | stat: -rw-r--r-- 6,802 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264

TWOLAME(1)
==========
Nicholas J Humfrey <njh@aelius.com>


NAME
----
twolame - an optimised MPEG Audio Layer 2 (MP2) encoder


SYNOPSIS
--------
'twolame' [options] <infile> [outfile]


DESCRIPTION
-----------
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. 


OPTIONS
-------
Input File
~~~~~~~~~~
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.


Output File
~~~~~~~~~~~
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.


Input Options
~~~~~~~~~~~~~
-r, --raw-input::
	Specifies that input is raw signed PCM audio.
	If audio is stereo, than audio samples are interleaved 
	between the two channels.

-x, --byte-swap::
	Force byte-swapping of the input. Endian detection is performed 
	automatically by libsndfile, so this option shouldn't 
	normally be needed.

-s, --samplerate <int>::
	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. 

--samplesize <int>::
	Specifies the sample size (in bits) of the raw PCM audio.
	Valid sample sizes: 8, 16, 24, 32.
	Default sample size is 16-bit. 

-N, --channels <int>::
	If inputting raw PCM sound, you must specify the number of channels 
	in the input audio. Default number of channels is 2.

-g, --swap-channels::
	Swap the Left and Right channels of a stereo input file.

--scale <float>::
	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.

--scale-l <float>::
	Same as --scale, but only affects the left channel. 

--scale-r <float>::
	Same as --scale, but only affects the right channel. 


Output Options
~~~~~~~~~~~~~~

-m, --mode <char>::
	Choose the mode of the resulting audio. Default is auto.
	- "a" auto - choose mode automatically based on the input
	- "s" stereo
	- "d" dual channel
	- "j" joint stereo
	- "m" mono

-a, --downmix::
	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.

-v, --vbr::
	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.

-S, --single-frame::
	Enables single frame mode: only a single frame of MPEG audio 
	is output and then the program terminates.



Miscellaneous Options
~~~~~~~~~~~~~~~~~~~~~

-c, --copyright::
	Turn on Copyright flag in output bitstream.

-o, --non-original::
	Turn off Original flag in output bitstream.
	
--original::
	Turn on Original flag in output bitstream.

-p, --protect::
	Enable CRC error protection in output bitstream.
	An extra 16-bit checksum is added to frames.
	
-d, --padding::
	Turn 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, --energy::
	Turn on energy level extensions.


Verbosity Options
~~~~~~~~~~~~~~~~~

-t, --talkativity <int>::
	Set the amount of information to be displayed on stderr (0 to 10).
	Default is 2.
	
--quiet::
	Don't send any messages to stderr, unless there is an error.
	(Same as --talkativity=0)

--brief::
	Only display a minimal number of messages while encoding.
	This setting is quieter than the default talkativity setting.
	(Same as --talkativity=1)

--verbose::
	Display an increased number of messages on stderr.
	This setting is useful to diagnose problems.
	(Same as --talkativity=4)



Return Codes
------------

If encoding completes successfully, then twolame will return 0.
However if encoding is not successful, then it will return one of the following codes.
	
	- 1 (No encoding performed)
	- 2 (Error opening input file)
	- 4 (Error opening output file)
	- 6 (Error allocating memory)
	- 8 (Error in chosen encoding parameters)
	- 10 (Error reading input audio)
	- 12 (Error occured while encoding)
	- 14 (Error writing output audio)


EXAMPLES
--------

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):

	twolame sound.wav

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 


AUTHORS
-------
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.


RESOURCES
---------
TwoLAME web site: http://www.twolame.org/


SEE ALSO
--------
lame(1), mpg123(1), madplay(1), sox(1)


COPYING
-------
Copyright (C) 2004-2006 The TwoLAME Project. Free use of this software is
granted under the terms of the GNU Lesser General Public License (LGPL).