comparison DOCS/sound.html @ 8891:5b73c925436e

Further libaf documentation by Anders with some more updates by me.
author diego
date Sat, 11 Jan 2003 14:09:19 +0000
parents 9476ccf6a41d
children 8fd72eae8886
comparison
equal deleted inserted replaced
8890:c9cbfb9d720c 8891:5b73c925436e
187 -srate 11025 media.avi</CODE></P> 187 -srate 11025 media.avi</CODE></P>
188 188
189 <P>would set the output frequency of the resample filter to 11025Hz and downmix 189 <P>would set the output frequency of the resample filter to 11025Hz and downmix
190 the audio to 1 channel using the pan filter.</P> 190 the audio to 1 channel using the pan filter.</P>
191 191
192 <P>Most filters respond to the <CODE>-v</CODE> switch, which makes the filters
193 print out status messages.</P>
194
195 <P>The overall execution of the filter layer is controlled using the 192 <P>The overall execution of the filter layer is controlled using the
196 <CODE>-af-adv</CODE> switch. This switch has two suboptions:</P> 193 <CODE>-af-adv</CODE> switch. This switch has two suboptions:</P>
197 194
198 <DL> 195 <DL>
199 <DT><CODE>force</CODE><DT> 196 <DT><CODE>force</CODE><DT>
200 <DD>is an integer between 0 and 3 that controls how the filters are inserted 197 <DD>is a Bit field that controls how the filters are inserted and what
201 and what speed/accuracy optimizations they use: 198 speed/accuracy optimizations they use:
202 <DL> 199 <DL>
203 <DT>0</DT> 200 <DT><CODE>0</CODE></DT>
204 <DD>Use automatic insertion of filters and optimize according to CPU 201 <DD>Use automatic insertion of filters and optimize according to CPU
205 speed.</DD> 202 speed.</DD>
206 <DT>1</DT> 203 <DT><CODE>1</CODE></DT>
207 <DD>Use automatic insertion of filters and optimize for the highest speed. 204 <DD>Use automatic insertion of filters and optimize for the highest
208 If this option is set the processing of the audio data will be done 205 speed.<BR>
209 using fix point arithmetics. Warning: Some features in the audio filters 206 <EM>Warning:</EM> Some features in the audio filters may silently fail,
210 will silently fail, and the sound quality may drop.</DD> 207 and the sound quality may drop.</DD>
211 <DT>2</DT> 208 <DT><CODE>2</CODE></DT>
212 <DD>Use automatic insertion of filters and optimize for quality. If this 209 <DD>Use automatic insertion of filters and optimize for quality.</DD>
213 option is set the processing of the audio data will be done using 210 <DT><CODE>3</CODE></DT>
214 floating point instructions and is therefore quite CPU intensive, but 211 <DD>Use no automatic insertion of filters and no optimization.<BR>
215 gives a lot higher sound quality than fix point processing.</DD> 212 <I>Warning:</I> It may be possible to crash MPlayer using this
216 <DT>3</DT> 213 setting.</DD>
217 <DD>Use no automatic insertion of filters and no optimization. Warning: It 214 <DT><CODE>4</CODE></DT>
218 may be possible to crash MPlayer using this setting.</DD> 215 <DD>Use automatic insertion of filters according to 0 above, but use
216 floating point processing when possible.</DD>
217 <DT><CODE>5</CODE></DT>
218 <DD>Use automatic insertion of filters according to 1 above, but use
219 floating point processing when possible.</DD>
220 <DT><CODE>6</CODE></DT>
221 <DD>Use automatic insertion of filters according to 2 above, but use
222 floating point processing when possible.</DD>
223 <DT><CODE>7</CODE></DT>
224 <DD>Use no automatic insertion of filters according to 3 above, and use
225 floating point processing when possible.</DD>
219 </DL> 226 </DL>
220 </DD> 227 </DD>
221 228
222 <DT><CODE>list</CODE></DT> 229 <DT><CODE>list</CODE></DT>
223 <DD>is an alias for the -af switch.</DD> 230 <DD>is an alias for the -af switch.</DD>
231 </DL>
232
233 <P>The filter layer is also affected by the following generic switches:
234
235 <DL>
236 <DT><CODE>-v</CODE></DT>
237 <DD>Increases the verbosity level and makes most filters print out extra
238 status messages.</DD>
239 <DT><CODE>-channels</CODE></DT>
240 <DD>This option sets the number of output channels your sound card is using.
241 It also affects the number of channels that are being decoded from the
242 media. If the media contains less channels than requested the channels
243 filter (see below) will automatically be inserted. The routing will be the
244 default routing for the channels filter.</DD>
245 <DT><CODE>-srate</CODE></DT>
246 <DD>This option selects the sample rate of your sound card. If the sample
247 frequency of your sound card is different from that of the current media,
248 the resample filter (see below) will be inserted into the audio filter layer
249 to compensate for the difference.</DD>
250 <DT><CODE>-format</CODE><DT>
251 <DD>This option sets the sample format of the audio filter layer and the sound
252 card. If the requested sample format of your sound card is different from
253 that of the current media, a format filter (see below) will be inserted to
254 rectify the difference.</DD>
224 </DL> 255 </DL>
225 256
226 257
227 <H5><A NAME="af_resample">2.3.2.3.1 Up/Down-sampling</A></H5> 258 <H5><A NAME="af_resample">2.3.2.3.1 Up/Down-sampling</A></H5>
228 259
231 that is only capable of max 44.1kHz. This filter is automatically enabled if 262 that is only capable of max 44.1kHz. This filter is automatically enabled if
232 it is necessary, but it can also be explicitly enabled on the command line. It 263 it is necessary, but it can also be explicitly enabled on the command line. It
233 has three switches:</P> 264 has three switches:</P>
234 265
235 <DL> 266 <DL>
236 <DT><CODE>srate</CODE></DT> 267 <DT><CODE>srate &lt;8-192&gt;</CODE></DT>
237 <DD>is an integer used for setting the output sample 268 <DD>is an integer used for setting the output sample
238 frequency in Hz. The valid range for this parameter is 8kHz to 192kHz. If 269 frequency in Hz. The valid range for this parameter is 8kHz to 192kHz. If
239 the input and output sample frequency are the same or if this parameter is 270 the input and output sample frequency are the same or if this parameter is
240 omitted the filter is automatically unloaded. A high sample frequency 271 omitted the filter is automatically unloaded. A high sample frequency
241 normally improves the audio quality, especially when used in combination 272 normally improves the audio quality, especially when used in combination
242 with other filters.</DD> 273 with other filters.</DD>
243 274
244 <DT><CODE>sloppy</CODE></DT> 275 <DT><CODE>sloppy</CODE></DT>
245 <DD>is an optional binary parameter that allows the output frequency to differ 276 <DD>is an optional binary parameter that allows the output frequency to differ
246 slightly from the frequency given by <CODE>srate</CODE>. This switch can be 277 slightly from the frequency given by <CODE>srate</CODE>. This switch can be
247 used if the startup of the playback is extremely slow.</DD> 278 used if the startup of the playback is extremely slow. It is enabled by
248 279 default.</DD>
249 <DT><CODE>fast</CODE><DT> 280
250 <DD>is an optional binary parameter that enables linear interpolation as 281 <DT><CODE>type &lt;0-2&gt;</CODE><DT>
251 resampling method. Linear interpolation is extremely fast, but suffers from 282 <DD>is an optional integer between <CODE>0</CODE> and <CODE>2</CODE> that
252 poor sound quality especially when used for up-sampling.</DD> 283 selects which resampling method to use. Here <CODE>0</CODE> represents
284 linear interpolation as resampling method, <CODE>1</CODE> represents
285 resampling using a poly-phase filter-bank and integer processing and
286 <CODE>2</CODE> represents resampling using a poly-phase filter-bank and
287 floating point processing. Linear interpolation is extremely fast, but
288 suffers from poor sound quality especially when used for up-sampling. The
289 best quality is given by <CODE>2</CODE> but this method also suffers from
290 the highest CPU load.</DD>
253 </DL> 291 </DL>
254 292
255 <P>Example:<BR> 293 <P>Example:<BR>
256 &nbsp;&nbsp;<CODE>mplayer -af resample=44100:0:1</CODE></P> 294 &nbsp;&nbsp;<CODE>mplayer -af resample=44100:0:1</CODE></P>
257 295
266 automatically enabled when the output from the audio filter layer differs from 304 automatically enabled when the output from the audio filter layer differs from
267 the input layer or when it is requested by another filter. This filter unloads 305 the input layer or when it is requested by another filter. This filter unloads
268 itself if not needed. The number of switches is dynamic:</P> 306 itself if not needed. The number of switches is dynamic:</P>
269 307
270 <DL> 308 <DL>
271 <DT><CODE>nch</CODE></DT> 309 <DT><CODE>nch &lt;1-6&gt;</CODE></DT>
272 <DD>is an integer between 1 and 6 that is used for setting the number of 310 <DD>is an integer between <CODE>1</CODE> and <CODE>6</CODE> that is used for
273 output channels. This switch is required, leaving it empty results in a 311 setting the number of output channels. This switch is required, leaving it
274 runtime error.</DD> 312 empty results in a runtime error.</DD>
275 313
276 <DT><CODE>nr</CODE></DT> 314 <DT><CODE>nr &lt;1-6&gt;</CODE></DT>
277 <DD>is an integer between 1 and 6 that is used for specifying the number of 315 <DD>is an integer between <CODE>1</CODE> and <CODE>6</CODE> that is used for
278 routes. This parameter is optional. If it is omitted the default routing is 316 specifying the number of routes. This parameter is optional. If it is
279 used.</DD> 317 omitted the default routing is used.</DD>
280 318
281 <DT><CODE>from1:to1:from2:to2:from3:to3...</CODE></DT> 319 <DT><CODE>from1:to1:from2:to2:from3:to3...</CODE></DT>
282 <DD>are pairs of numbers between 0 and 5 that define where each channel should 320 <DD>are pairs of numbers between <CODE>0</CODE> and <CODE>5</CODE> that define
283 be routed.</DD> 321 where each channel should be routed.</DD>
284 </DL> 322 </DL>
285 323
286 <P>If only <CODE>nch</CODE> is given the default routing is used, it works as 324 <P>If only <CODE>nch</CODE> is given the default routing is used, it works as
287 follows: If the number of output channels is bigger than the number of input 325 follows: If the number of output channels is bigger than the number of input
288 channels empty channels are inserted (except mixing from mono to stereo, then 326 channels empty channels are inserted (except mixing from mono to stereo, then
309 347
310 <P>This filter is a sample format converter. It is automatically enabled when 348 <P>This filter is a sample format converter. It is automatically enabled when
311 needed by the sound card or another filter.</P> 349 needed by the sound card or another filter.</P>
312 350
313 <DL> 351 <DL>
314 <DT><CODE>bps</CODE></DT> 352 <DT><CODE>bps &lt;number&gt;</CODE></DT>
315 <DD>can be 1, 2 or 4 and denotes the number of bytes per sample. This switch 353 <DD>can be <CODE>1</CODE>, <CODE>2</CODE> or <CODE>4</CODE> and denotes the
316 is required, leaving it empty results in a runtime error.</DD> 354 number of bytes per sample. This switch is required, leaving it empty
317 355 results in a runtime error.</DD>
318 <DT><CODE>f</CODE></DT> 356
357 <DT><CODE>f &lt;format&gt;</CODE></DT>
319 <DD>is a text string describing the sample format. The string is a 358 <DD>is a text string describing the sample format. The string is a
320 concatenated mix of: <CODE>alaw</CODE>, <CODE>mulaw</CODE> or 359 concatenated mix of: <CODE>alaw</CODE>, <CODE>mulaw</CODE> or
321 <CODE>imaadpcm</CODE>, <CODE>float</CODE> or <CODE>int</CODE>, 360 <CODE>imaadpcm</CODE>, <CODE>float</CODE> or <CODE>int</CODE>,
322 <CODE>unsigned</CODE> or <CODE>signed</CODE>, <CODE>le</CODE> or 361 <CODE>unsigned</CODE> or <CODE>signed</CODE>, <CODE>le</CODE> or
323 <CODE>be</CODE> (little or big endian). This switch is required, leaving it 362 <CODE>be</CODE> (little or big endian). This switch is required, leaving it
375 always the case), the noise level can be minimized by adjusting the master 414 always the case), the noise level can be minimized by adjusting the master
376 level and the volume knob on the amplifier until the hissing noise in the 415 level and the volume knob on the amplifier until the hissing noise in the
377 background is gone. This filter has two switches:</P> 416 background is gone. This filter has two switches:</P>
378 417
379 <DL> 418 <DL>
380 <DT><CODE>v</CODE></DT> 419 <DT><CODE>v &lt;-200 - +60&gt;</CODE></DT>
381 <DD>is a floating point number between -200 and +60 which represents the 420 <DD>is a floating point number between <CODE>-200</CODE> and <CODE>+60</CODE>
382 volume level in dB. The default level is -10dB.</DD> 421 which represents the volume level in dB. The default level is -10dB.</DD>
383 422
384 <DT><CODE>c</CODE></DT> 423 <DT><CODE>c</CODE></DT>
385 <DD>is a binary control that turns soft clipping on and off. Soft-clipping can 424 <DD>is a binary control that turns soft clipping on and off. Soft-clipping can
386 make the sound more smooth if very high volume levels are used. Enable this 425 make the sound more smooth if very high volume levels are used. Enable this
387 switch if the dynamic range of the loudspeakers is very low. Be aware that 426 switch if the dynamic range of the loudspeakers is very low. Be aware that
400 utilized.</P> 439 utilized.</P>
401 440
402 441
403 <H5><A NAME="af_equalizer">2.3.2.3.6 Equalizer</A></H5> 442 <H5><A NAME="af_equalizer">2.3.2.3.6 Equalizer</A></H5>
404 443
405 <P> This filter is a 10 octave band graphic equalizer, implemented using 10 IIR 444 <P>This filter is a 10 octave band graphic equalizer, implemented using 10 IIR
406 band pass filters. This means that it works regardless of what type of audio 445 band pass filters. This means that it works regardless of what type of audio
407 is being played back. The center frequencies for the 10 bands are:</P> 446 is being played back. The center frequencies for the 10 bands are:</P>
408 447
409 <TABLE BORDER="0" WIDTH="100%"> 448 <TABLE BORDER="0" WIDTH="100%">
410 <TR><TD>Band No.</TD><TD>Center frequency</TD></TR> 449 <TR><TD>Band No.</TD><TD>Center frequency</TD></TR>
425 with this filter is that the characteristics for the uppermost band are not 464 with this filter is that the characteristics for the uppermost band are not
426 completely symmetric if the sample rate is close to the center frequency of 465 completely symmetric if the sample rate is close to the center frequency of
427 that band. This problem can be worked around by up-sampling the sound using 466 that band. This problem can be worked around by up-sampling the sound using
428 the resample filter before it reaches this filter. </P> 467 the resample filter before it reaches this filter. </P>
429 468
430 <P> This filter has 10 parameters:</P> 469 <P>This filter has 10 parameters:</P>
431 470
432 <DL> 471 <DL>
433 <DT><CODE>g1:g2:g3...g10</CODE></DT> 472 <DT><CODE>g1:g2:g3...g10</CODE></DT>
434 <DD>are floating point numbers between -12 to +12dB representing the gain in 473 <DD>are floating point numbers between <CODE>-12<CODE> and <CODE>+12</CODE>
435 dB for each frequency band.</DD> 474 representing the gain in dB for each frequency band.</DD>
436 </DL> 475 </DL>
437 476
438 <P>Example:<BR> 477 <P>Example:<BR>
439 &nbsp;&nbsp;<CODE>mplayer -af equalizer=11:11:10:5:0:-12:0:5:12:12 media.avi</CODE></P> 478 &nbsp;&nbsp;<CODE>mplayer -af equalizer=11:11:10:5:0:-12:0:5:12:12 media.avi</CODE></P>
440 479
455 <P>This filter is hard to use, and will require some tinkering before the 494 <P>This filter is hard to use, and will require some tinkering before the
456 desired result is obtained. The number of switches for this filter depends on 495 desired result is obtained. The number of switches for this filter depends on
457 the number of output channels:</P> 496 the number of output channels:</P>
458 497
459 <DL> 498 <DL>
460 <DT><CODE>nch</CODE></DT> 499 <DT><CODE>nch &lt;1-6&gt;</CODE></DT>
461 <DD>is an integer between 1 and 6 and is used for setting the number of output 500 <DD>is an integer between <CODE>1</CODE> and <CODE>6</CODE> and is used for
462 channels. This switch is required, leaving it empty results in a runtime 501 setting the number of output channels. This switch is required, leaving it
463 error.</DD> 502 empty results in a runtime error.</DD>
464 503
465 <DT><CODE>l00:l01:l02:..l10:l11:l12:...ln0:ln1:ln2:...</CODE></DT> 504 <DT><CODE>l00:l01:l02:..l10:l11:l12:...ln0:ln1:ln2:...</CODE></DT>
466 <DD>are floating point values between 0 and 1. <CODE>l[i][j]</CODE> determines 505 <DD>are floating point values between <CODE>0</CODE> and <CODE>1</CODE>.
467 how much of input channel j is mixed into output channel i.</DD> 506 <CODE>l[i][j]</CODE> determines how much of input channel j is mixed into
507 output channel i.</DD>
468 </DL> 508 </DL>
469 509
470 <P>Example 1:<BR> 510 <P>Example 1:<BR>
471 &nbsp;&nbsp;<CODE>mplayer -af pan=1:0.5:0.5 -channels 1 media.avi</CODE></P> 511 &nbsp;&nbsp;<CODE>mplayer -af pan=1:0.5:0.5 -channels 1 media.avi</CODE></P>
472 512
476 &nbsp;&nbsp;<CODE>mplayer -af pan=3:1:0:1:0.5:0.5 -channels 3 media.avi</CODE></P> 516 &nbsp;&nbsp;<CODE>mplayer -af pan=3:1:0:1:0.5:0.5 -channels 3 media.avi</CODE></P>
477 517
478 <P>would give 3 channel output leaving channels 0 and 1 intact, and mix channels 518 <P>would give 3 channel output leaving channels 0 and 1 intact, and mix channels
479 0 and 1 into output channel 2 (which could be sent to a sub-woofer for 519 0 and 1 into output channel 2 (which could be sent to a sub-woofer for
480 example).</P> 520 example).</P>
521
522
523 <H5><A NAME="af_sub">2.3.2.3.8 Sub-woofer</A></H5>
524
525 <P>This filter adds a sub woofer channel to the audio stream. The audio data
526 used for creating the sub-woofer channel is an average of the sound in channel
527 0 and channel 1. The resulting sound is then low-pass filtered by a a 4th
528 order Butterworth filter with a default cutoff frequency of 60Hz and added to
529 a separate channel in the audio stream. Warning: Disable this filter when you
530 are playing DVDs with Dolby Digital 5.1 sound, otherwise this filter will
531 disrupt the sound to the sub-woofer. This filter has two parameters:</P>
532
533 <DL>
534 <DT><CODE>fc &lt;20-300&gt;</CODE></DT>
535 <DD>is an optional floating point number used for setting the cutoff frequency
536 for the filter in Hz. The valid range is 20Hz to 300Hz. For the best result
537 try setting the cutoff frequency as low as possible. This will improve the
538 stereo or surround sound experience. The default cutoff frequency is
539 60Hz.</DD>
540
541 <DT><CODE>ch &lt;0-5&gt;</CODE></DT>
542 <DD>is an optional integer between <CODE>0</CODE> and <CODE>5</CODE> which
543 determines the channel number in which to insert the sub-channel audio.
544 The default is channel number <CODE>5</CODE>. Observe that the number of
545 channels will automatically be increased to <CODE>ch</CODE> if
546 necessary.</DD>
547 </DL>
548
549 <P>Example:<BR>
550 &nbsp;&nbsp;<CODE>mplayer -af sub=100:4 -channels 5 media.avi</CODE></P>
551
552 <P>would add a sub-woofer channel with a cutoff frequency of 100Hz to output
553 channel 4.</P>
554
555 <H5><A NAME="af_surround">2.3.2.3.9 Surround-sound decoder</A></H5>
556
557 <P>This filter is a decoder for matrix encoded surround sound. Dolby Surround is
558 an example of a matrix encoded format. Many files with 2 channel audio
559 actually contain matrixed surround sound. To use this feature you need a sound
560 card supporting at least 4 channels. This filter has one parameter:</P>
561
562 <DL>
563 <DT><CODE>d &lt;0-1000&gt;</CODE></DT>
564 <DD>is an optional floating point number between <CODE>0</CODE> and
565 <CODE>1000</CODE> used for setting the delay time in ms for the rear
566 speakers. This delay should be set as follows: if d1 is the distance from
567 the listening position to the front speakers and d2 is the distance from
568 the listening position to the rear speakers, then the delay <CODE>d</CODE>
569 should be set to 15ms if d1 &lt;= d2 and to 15 + 5*(d1-d2) if d1 &gt; d2.
570 The default value for <CODE>d</CODE> is 20ms.</DD>
571 </DL>
572
573 <P>Example:<BR>
574 &nbsp;&nbsp;<CODE>mplayer -af surround=15 -channels 4 media.avi</CODE></P>
575
576 <P>would add a surround sound decoding with 15ms delay for the sound to the rear
577 speakers.</P>
578
579
481 580
482 581
483 <H2><STRONG>Note: Audio plugins have been deprecated by audio filters and will be 582 <H2><STRONG>Note: Audio plugins have been deprecated by audio filters and will be
484 removed soon.</STRONG></H2> 583 removed soon.</STRONG></H2>
485 584