I used DirectSound for recording sound. I want to record only when someone
speeches not when she's silent. So I checked average of capture buffer. If it
is between 123 and 132, sounds aren't recorded:
for( cT = 0; cT < nSizeToWrite; cT++ )
{
avg = avg + *((BYTE*)pbSrcData+cT);
}
avg = avg / nSizeToWrite;
if(avg > 132 || avg < 123 ){
//record in wave file.
...
Unfortunately it doesn't work properly. Silences are recorded mostly. isthat because of environment noise ? how can i suppression it?











