Tom Grandgent
2008-Aug-29 22:41 UTC
[Speex-dev] Fw: Voice Activation Level (speex 1.1.11.1)
Manisha, I'm still here. :-) Here's the function: // Returns the average power level in the given signal float getPower(signed short int *signal, int numSamples) { int i; float amp; float powerSum = 0.0f; for (i = 0; i < numSamples; i++) { amp = (float) abs(signal[i]); powerSum += amp * amp; } return powerSum / (32768.0f * 32768.0f * (float) numSamples); } Note that you should determine an activation threshold experimentally and consider offering UI to adjust it, if possible. Tom manisha.tidke at aftek.com wrote:> > > Hi > > I am facing the same problem as the speex VAD detecting background > noises(far away speech data ) also and passing it ahead as voice. Can you > please tell me where/how to use the calcPower or getPower function > described by Tom? > > Thnks > Regards > Manisha