customize-audio-samplerate.html

来自「Intercom 是一个 Unix系统上灵活的语音传输软件。支持标准音频压缩比如」· HTML 代码 · 共 521 行

HTML
521
字号
<HTML><HEAD><TITLE>Selecting a Sample Rate</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.77+"><LINKREL="HOME"TITLE="Intercom"HREF="intercom.html"><LINKREL="UP"TITLE="Customizing Intercom for Your Needs"HREF="customize.html"><LINKREL="PREVIOUS"TITLE="Audio parameters"HREF="customize-audio.html"><LINKREL="NEXT"TITLE="Networking Parameters"HREF="network.html"></HEAD><BODYCLASS="SECTION"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Intercom: Version 0.15 Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="customize-audio.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 4. Customizing Intercom for Your Needs</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="network.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECTION"><H1CLASS="SECTION"><ANAME="CUSTOMIZE-AUDIO-SAMPLERATE"></A>Selecting a Sample Rate</H1><P>The audio sample rate is quite possibly the single most importantfactor in determining audio quality.  The higher the sampling rate, thebetter the audio quality.  Of course, the bandwidth requirements areincreased as well.  Technically, Intercom can support any sample rate yourhardware can, however, as the remote caller must also support the samplerate, it is recommended that you stick to the standard rates.  These are8000 (8k), 11025 (11k), 16000 (16k), 22050 (22k) and 32000 (32k).</P><DIVCLASS="NOTE"><P></P><TABLECLASS="NOTE"WIDTH="100%"BORDER="0"><TR><TDWIDTH="25"ALIGN="CENTER"VALIGN="TOP"><IMGSRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"HSPACE="5"ALT="Note"></TD><TDALIGN="LEFT"VALIGN="TOP"><P>Some sound cards do not support the 16k sample rate.  However,some do and it is often a good one to use if you know that both partiessupport it.</P></TD></TR></TABLE></DIV><P>The sampling rate is controled in one of two ways.  You can either setthe snd_rate variable to your desired sample rate or specify a one-timesample rate when placing a call.  To set the variable, use a command like<BCLASS="COMMAND">set snd_rate 11025</B> to set the sample rate to 11k.  Inorder to place a call with a sample rate other than that in the snd_ratevariable, specify the -r option such as<BCLASS="COMMAND">call -r <TTCLASS="REPLACEABLE"><I>22050</I></TT><TTCLASS="REPLACEABLE"><I>192.168.1.2</I></TT></B> which will set the rate to 22kfor the duration of the call.</P><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="CUSTOMIZE-AUDIO-CODEC"></A>Compression Settings</H2><P>Another setting which plays a large part in audio quality and an evenlarger part in bandwidth usage is the compression format (CODEC) selected. Certain CODECs give better compression at the expense of audio quality orCPU utilization.  Alternatively, you can disable compression altogether ifyour connection can handle the increased data throughput.</P><P>The following table lists the currently supported codecs as well asthe bandwidth they use at several sample rates.  The bandwidth usage isdisplayed in killobits per second.  1 killobit equals 1000 bits which is 125bytes.  Also note that this does not account for Intercom's protocoloverhead which varies depending on other factors.</P><DIVCLASS="TABLE"><ANAME="AEN285"></A><P><B>Table 4-1. Audio CODEC Bandwidth Usage</B></P><TABLEBORDER="1"CLASS="CALSTABLE"><THEAD><TR><THALIGN="LEFT"VALIGN="TOP">Sample rate</TH><THALIGN="LEFT"VALIGN="TOP">8 K</TH><THALIGN="LEFT"VALIGN="TOP">11 K</TH><THALIGN="LEFT"VALIGN="TOP">16 K</TH><THALIGN="LEFT"VALIGN="TOP">22 K</TH><THALIGN="LEFT"VALIGN="TOP">32 K</TH></TR><TR><THALIGN="LEFT"VALIGN="TOP">CODEC</TH><THALIGN="LEFT"VALIGN="TOP">Kbit/sec</TH><THALIGN="LEFT"VALIGN="TOP">Kbit/sec</TH><THALIGN="LEFT"VALIGN="TOP">Kbit/sec</TH><THALIGN="LEFT"VALIGN="TOP">Kbit/sec</TH><THALIGN="LEFT"VALIGN="TOP">Kbit/sec</TH></TR></THEAD><TBODY><TR><TDALIGN="LEFT"VALIGN="TOP">none</TD><TDALIGN="LEFT"VALIGN="TOP">128.00</TD><TDALIGN="LEFT"VALIGN="TOP">176.40</TD><TDALIGN="LEFT"VALIGN="TOP">256.00</TD><TDALIGN="LEFT"VALIGN="TOP">352.80</TD><TDALIGN="LEFT"VALIGN="TOP">512.00</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP">G.711</TD><TDALIGN="LEFT"VALIGN="TOP">64.00</TD><TDALIGN="LEFT"VALIGN="TOP">88.20</TD><TDALIGN="LEFT"VALIGN="TOP">128.00</TD><TDALIGN="LEFT"VALIGN="TOP">176.40</TD><TDALIGN="LEFT"VALIGN="TOP">256.00</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP">G.721</TD><TDALIGN="LEFT"VALIGN="TOP">32.00</TD><TDALIGN="LEFT"VALIGN="TOP">44.10</TD><TDALIGN="LEFT"VALIGN="TOP">64.00</TD><TDALIGN="LEFT"VALIGN="TOP">88.20</TD><TDALIGN="LEFT"VALIGN="TOP">128.00</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP">G.723-40</TD><TDALIGN="LEFT"VALIGN="TOP">40.00</TD><TDALIGN="LEFT"VALIGN="TOP">55.12</TD><TDALIGN="LEFT"VALIGN="TOP">80.00</TD><TDALIGN="LEFT"VALIGN="TOP">110.25</TD><TDALIGN="LEFT"VALIGN="TOP">160.00</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP">G.723-24</TD><TDALIGN="LEFT"VALIGN="TOP">24.00</TD><TDALIGN="LEFT"VALIGN="TOP">33.08</TD><TDALIGN="LEFT"VALIGN="TOP">48.00</TD><TDALIGN="LEFT"VALIGN="TOP">66.15</TD><TDALIGN="LEFT"VALIGN="TOP">96.00</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP">GSM</TD><TDALIGN="LEFT"VALIGN="TOP">13.20</TD><TDALIGN="LEFT"VALIGN="TOP">18.19</TD><TDALIGN="LEFT"VALIGN="TOP">26.40</TD><TDALIGN="LEFT"VALIGN="TOP">36.38</TD><TDALIGN="LEFT"VALIGN="TOP">52.80</TD></TR></TBODY></TABLE></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="CUSTOMIZE-GAIN"></A>Software Gain Control</H2><P>If you or your remote party is sounding too quiet, the first thingwhich should be attempted is to adjust the sound mixer for the capturesource.  Bringing up the input gain can usually help.  Also, some audiohardware has an analogue mic boost option which you might try enabling. However, if all else fails, Intercom does have the ability to amplify orde-amplify the audio signal (either incoming or outgoing).  The reason youshould use the mixer before trying this is when you amplify a signal, youalso amplify the hiss along with it whereas a hardware gain usually isbetter at keeping things clean.</P><P>The variables controling gain are input_gain and output_gainrespectively.  The input_gain variable with amplify the signal coming fromyour mic before it goes out over the wire.  The output_gain variableamplifies the incoming signal.  These variables are decimal numbers whichexpress the gain in decibels.  A value of 0 turns off gain control, apositive value amplifies the signal by that many decibels and a negativevalue will de-amplify the signal.</P></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="CUSTOMIZE-AUDIO-DEVICE"></A>Audio Devices</H2><P>If you have more than one sound card, you may wish to specify the audiodevice Intercom uses.  There are two variables which control this,snd_capture_device and snd_play_device.  By default, they are both set to/dev/dsp but can be modified by the user.  The changes will not takeaffect immediately if a call is in progress.</P><P>You are free to set snd_capture_device and snd_play_device todifferent physical devices.  This might be useful if your Mic and speakershappen to be on different cards&#62;</P></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="CUSTOMIZE-AUDIO-SILENCE"></A>Handling Silence</H2><P>Another set of options which you will probably want to configure ishow Intercom handles audio silence.  That is, when you are not speaking,there is really no reason audio data needs to be sent to your remote party. Configuring silence squelching is a bit technical but shouldn't be too hard. The option you want to adjust is the silence_thresh variable.  This is aninteger between 0 and 32767 which denotes the minimum sample value belowwhich is considered silence.  When set to 0, there will be no silencesuppression and all audio data is sent as-is.  Likewise, when set to 32767,all audio data is squelched and you are essentially muted.  You want to setthis option to a value depending on your mic and surroundings.  Commonvalues are between 1000 and 7000 but your mileage may vary.  Play with ituntil you find the correct value for your setup</P><P>The other variable related to silence squelching is silence_time. This is a decimal variable which controls how many seconds of silence toallow before squelching.  By default, this is set to 1.0 (1 second) but somepeople like to adjust it.  For example, if you wanted to squelch only ifthere is an extended period of silence, you could set it to 30 or so.</P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="customize-audio.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="intercom.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="network.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Audio parameters</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="customize.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Networking Parameters</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

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