advaudio.html

来自「MPlayer-mingw32-1.0rc2.zip 经典播放器源码」· HTML 代码 · 共 391 行 · 第 1/2 页

HTML
391
字号
</pre><p>
</p><p>
The advantage this example has over <tt class="option">extrastereo</tt> is that the
volume of each output channel is the same as the input channel. The disadvantage
is that the suboptions must be changed to "2:2:1:0:1:1" when the desired audio
is in the right channel. Also, it is more difficult to remember and type.
</p><h5><a name="id2574398"></a>Example: left channel in two speakers shortcut</h5><p>
There is actually a much easier way to use the <tt class="option">channels</tt> filter
for playing the left channel in both speakers:
</p><pre class="screen">mplayer <em class="replaceable"><code>filename</code></em> -af channels=1</pre><p>
The second channel is discarded and, with no further suboptions, the single
remaining channel is left alone. Sound card drivers automatically play
single-channel audio in both speakers. This only works when the desired channel
is on the left.
</p><h5><a name="id2574425"></a>Example: duplicate front channels to the rear</h5><p>
Another common operation is to duplicate the front channels and play them back
on the rear speakers of a quadraphonic setup.
</p><div class="orderedlist"><ol type="1"><li><p>
  There should be four output channels. The first suboption is "4".
</p></li><li><p>
  Each of the two front channels needs to be moved to the corresponding rear
  channel and also to itself. This is four moves, so the second suboption is "4".
</p></li><li><p>
  The left front (channel 0) needs to moved to the left rear (channel 2):
  "0:2".  The left front also needs to be moved to itself: "0:0". The right
  front (channel 1) is moved to the right rear (channel 3): "1:3", and also to
  itself: "1:1".
</p></li></ol></div><p>
Combine all the suboptions to get:
</p><pre class="screen">
mplayer <em class="replaceable"><code>filename</code></em> -af channels=4:4:0:2:0:0:1:3:1:1
</pre><p>
</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="advaudio-channels-mixing"></a>3.6.2.4.聽Channel mixing</h4></div></div></div><p>
The <tt class="option">pan</tt> filter can mix channels in user-specified proportions.
This allows for everything the <tt class="option">channels</tt> filter can do and
more. Unfortunately, the suboptions are much more complicated.
</p><div class="orderedlist"><ol type="1"><li><p>
  Decide how many channels to work with. You may need to specify this with
  <tt class="option">-channels</tt> and/or <tt class="option">-af channels</tt>.
  Later examples will show when to use which.
</p></li><li><p>
  Decide how many channels to feed into <tt class="option">pan</tt> (further decoded
  channels are discarded). This is the first suboption, and it also controls how
  many channels to employ for output.
</p></li><li><p>
  The remaining suboptions specify how much of each channel gets mixed into each
  other channel. This is the complicated part. To break the task down, split the
  suboptions into several sets, one set for each output channel. Each suboption
  within a set corresponds to an input channel. The number you specify will be
  the percentage of the input channel that gets mixed into the output channel.
  </p><p>
  <tt class="option">pan</tt> accepts values from 0 to 512, yielding 0% to 51200% of
  the original volume. Be careful when using values greater than 1. Not only
  can this give you very high volume, but if you exceed the sample range of
  your sound card you may hear painful pops and clicks. If you want you can
  follow <tt class="option">pan</tt> with <tt class="option">,volume</tt> to enable clipping,
  but it is best to keep the values of <tt class="option">pan</tt> low enough that
  clipping is not necessary.
  </p></li></ol></div><p>
</p><h5><a name="id2574569"></a>Example: one channel in two speakers</h5><p>
Here is yet another example for playing the left channel in two speakers. Follow
the steps above:
</p><div class="orderedlist"><ol type="1"><li><p>
  <tt class="option">pan</tt> should output two channels, so the first
  suboption is "2".
</p></li><li><p>
  Since we have two input channels, there will be two sets of suboptions.
  Since there are also two output channels,
  there will be two suboptions per set.
  The left channel from the file should go with full volume to
  the new left and the right channels.
  Thus the first set of suboptions is "1:1".
  The right channel should be discarded, so the second would be "0:0".
  Any 0 values at the end can be left out, but for ease of
  understanding we will keep them.
</p></li></ol></div><p>
Putting those options together gives:
</p><pre class="screen">mplayer <em class="replaceable"><code>filename</code></em> -af pan=2:1:1:0:0</pre><p>
If the right channel is desired instead of the left, the suboptions to
<tt class="option">pan</tt> will be "2:0:0:1:1".
</p><h5><a name="id2574621"></a>Example: left channel in two speakers shortcut</h5><p>
As with <tt class="option">channels</tt>, there is a shortcut that only works with the
left channel:
</p><pre class="screen">mplayer <em class="replaceable"><code>filename</code></em> -af pan=1:1</pre><p>
Since <tt class="option">pan</tt> has only one channel of input (the other channel is
discarded), there is only one set with one suboption, which specifies that the
only channel gets 100% of itself.
</p><h5><a name="id2574650"></a>Example: downmixing 6-channel PCM</h5><p>
<span class="application">MPlayer</span>'s decoder for 6-channel PCM is not capable of
downmixing. Here is a way to downmix PCM using <tt class="option">pan</tt>:
</p><div class="orderedlist"><ol type="1"><li><p>
  The number of output channels is 2, so the first suboption is "2".
</p></li><li><p>
  With six input channels there will be six sets of options. Fortunately,
  since we only care about the output of the first two channels, we only need to
  make two sets; the remaining four sets can be omitted. Beware that not all
  multichannel audio files have the same channel order! This example
  demonstrates downmixing a file with the same channels as AC-3 5.1:
  </p><pre class="programlisting">
0 - front left
1 - front right
2 - rear left
3 - rear right
4 - center front
5 - subwoofer</pre><p>
  The first set of suboptions lists the percentages of the original volume, in
  order, which each output channel should receive from the
  front left channel: "1:0".
  The front right channel should go into the right output: "0:1".
  The same for the rear channels: "1:0" and "0:1".
  The center channel goes into both output channels with half volume:
  "0.5:0.5", and the subwoofer goes into both with full volume: "1:1".
</p></li></ol></div><p>
Put all that together, for:
</p><pre class="screen">
mplayer <em class="replaceable"><code>6-channel.wav</code></em> -af pan=2:1:0:0:1:1:0:0:1:0.5:0.5:1:1
</pre><p>
The percentages listed above are only a rough example. Feel free to tweak them.
</p><h5><a name="id2574720"></a>Example: Playing 5.1 audio on big speakers without a subwoofer</h5><p>
If you have a huge pair of front speakers you may not want to waste any money on
buying a subwoofer for a complete 5.1 sound system. If you use
<tt class="option">-channels 5</tt> to request that liba52 decode 5.1 audio in 5.0,
the subwoofer channel is simply discarded. If you want to distribute the
subwoofer channel yourself you need to downmix manually with
<tt class="option">pan</tt>:
</p><div class="orderedlist"><ol type="1"><li><p>
  Since <tt class="option">pan</tt> needs to examine all six channels, specify
  <tt class="option">-channels 6</tt> so liba52 decodes them all.
</p></li><li><p>
  <tt class="option">pan</tt> outputs to only five channels, the first suboption is 5.
</p></li><li><p>
  Six input channels and five output channels means six sets of five suboptions.
  </p><div class="itemizedlist"><ul type="disc" compact><li><p>
    The left front channel only replicates onto itself:
    "1:0:0:0:0"
  </p></li><li><p>
    Same for the right front channel:
    "0:1:0:0:0"
  </p></li><li><p>
    Same for the left rear channel:
    "0:0:1:0:0"
  </p></li><li><p>
    And also the same for the right rear channel:
    "0:0:0:1:0"
  </p></li><li><p>
    Center front, too:
    "0:0:0:0:1"
  </p></li><li><p>
    And now we have to decide what to do with the subwoofer,
    e.g. half into front right and front left:
    "0.5:0.5:0:0:0"
  </p></li></ul></div><p>
</p></li></ol></div><p>
Combine all those options to get:
</p><pre class="screen">
mplayer <em class="replaceable"><code>dvd://1</code></em> -channels 6 -af pan=5:1:0:0:0:0:0:1:0:0:0:0:0:1:0:0:0:0:0:1:0:0:0:0:0:1:0.5:0.5:0:0:0
</pre><p>
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="advaudio-volume"></a>3.6.3.聽Software Volume adjustment</h3></div></div></div><p>
Some audio tracks are too quiet to be heard comfortably without amplification.
This becomes a problem when your audio equipment cannot amplify the signal for
you. The <tt class="option">-softvol</tt> option directs
<span class="application">MPlayer</span> to use an internal mixer. You can then use
the volume adjustment keys (by default <span class="keycap"><b>9</b></span> and
<span class="keycap"><b>0</b></span>) to reach much higher volume levels. Note that this does not
bypass your sound card's mixer; <span class="application">MPlayer</span> only
amplifies the signal before sending it to your sound card.
The following example is a good start:
</p><pre class="screen">
mplayer <em class="replaceable"><code>quiet-file</code></em> -softvol -softvol-max 300
</pre><p>
The <tt class="option">-softvol-max</tt> option specifies the maximum allowable output
volume as a percentage of the
original volume. For example, <tt class="option">-softvol-max 200</tt> would allow the
volume to be adjusted up to twice its original level.
It is safe to specify a large value with
<tt class="option">-softvol-max</tt>; the higher volume will not be used until you
use the volume adjustment keys. The only disadvantage of a large value is that,
since <span class="application">MPlayer</span> adjusts volume by a percentage of the
maximum, you will not have as precise control when using the volume adjustment
keys. Use a lower value with <tt class="option">-softvol-max</tt> and/or specify
<tt class="option">-volstep 1</tt> if you need higher precision.
</p><p>
The <tt class="option">-softvol</tt> option works by controlling the
<tt class="option">volume</tt> audio filter. If you want to play a file at a certain
volume from the beginning you can specify <tt class="option">volume</tt> manually:
</p><pre class="screen">mplayer <em class="replaceable"><code>quiet-file</code></em> -af volume=10</pre><p>
This will play the file with a ten decibel gain. Be careful when using the
<tt class="option">volume</tt> filter - you could easily hurt your ears if you use
too high a value. Start low and work your way up gradually until you get a feel
for how much adjustment is required. Also, if you specify excessively high
values, <tt class="option">volume</tt> may need to clip the signal to avoid sending
your sound card data that is outside the allowable range; this will result in
distorted audio.
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="edl.html">Prev</a>聽</td><td width="20%" align="center"><a accesskey="u" href="usage.html">Up</a></td><td width="40%" align="right">聽<a accesskey="n" href="cd-dvd.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.5.聽Edit Decision Lists (EDL)聽</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">聽Chapter聽4.聽CD/DVD usage</td></tr></table></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?