<div dir="ltr"><div class="gmail_extra">Hi Kenneth,<br><br></div><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 8, 2014 at 3:09 PM, Kenneth Lerman <span dir="ltr"><<a href="mailto:lerman-speex@se-ltd.com" target="_blank">lerman-speex@se-ltd.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
I'm attempting to use speex preprocess for automatic gain control in an<br>
application I'm working on and could use some help.<br>
<br>
I'm using Opus as my codec. In order to keep the number of packets down,<br>
I'm using 60msec frames. I'm sampling at 48KHz as is recommended for Opus.<br>
<br>
So, the frame length is 2880 samples and the sampling rate is 48000. The<br>
source of the data is a microphone using ALSA. That platform is Ubuntu.<br>
The version of speex is 1.2rc1.<br>
<br>
When I run with the default settings, the audio seems OK. It's not clear<br>
if preprocess is actually doing anything.<br>
<br>
If I turn AGC on, the sound level becomes almost inaudible.<br>
<br>
When I print the control parameters (the defaults), I get:<br>
DENOISE = 1<br>
AGC = 0<br>
AGC_LEVEL = 1174011904<br>
AGC_INCREMENT = 12<br>
AGC_DECREMENT = -40<br>
AGC_MAX_GAIN = 30<br>
VAD = 0<br>
DEREVERB = 0<br>
NOISE_SUPPRESS = -15<br>
<br>
QUESTION number 1: Is there a guide to "tuning" the AGC? Is there a<br>
document that tells what they really mean and how to adjust them?<br></blockquote><div><br></div><div>You might want to try calling SPEEX_PREPROCESS_SET_AGC_TARGET, <br></div><div>like so:<br>int target = 16000;<br>speex_preprocess_ctl(state, SPEEX_PREPROCESS_SET_AGC_TARGET, &target);<br>
<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
QUESTION number 2: I see that VAD, DEREVERB, DENOISE, ... have values of<br>
0 or 1. The documentation says that 1 means ON and 2 means OFF. Can<br>
someone explain the apparent discrepancy, please? (I assume that AGC = 0<br>
means that AGC is off.)<br></blockquote><div><br></div><div>This is a typo in the documentation, it has since been fixed (but not pushed online I guess):<br><a href="http://git.xiph.org/?p=speex.git;a=commitdiff;h=6da046b6c1afbe11f4efead4723df6a9f04d2097">http://git.xiph.org/?p=speex.git;a=commitdiff;h=6da046b6c1afbe11f4efead4723df6a9f04d2097</a><br>
<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
QUESTION number 3: Is there an easy way to search the archives of this list?<br></blockquote><div><br></div><div>Append "from site:<a href="http://lists.xiph.org/pipermail/speex-dev/">http://lists.xiph.org/pipermail/speex-dev/</a>" to your search.<br>
<br></div><div>Best,<br>Tristan <br><br></div></div>-- <br><div dir="ltr"><div>Tristan Matthews<br></div></div>
</div></div>