I am trying to implement automatic voice recording functionality, similar to the Talking Tom app. I use the following code to read input from the audio recorder and analyse the buffer :
float totalAbsValue = 0.0f;
short sample = 0;
numberOfReadBytes = audioRecorder.read( audioBuffer, 0, bufferSizeInBytes);
// Analyze Sound.
for( int i=0; i<bufferSizeInBytes; i+=2 )
{
sample = (short)( (audioBuffer[i]) | audioBuffer[i + 1] << 8 );
totalAbsValue += Math.abs( sample ) / (numberOfReadBytes/2);
}
// Analyze temp buffer.
tempFloatBuffer[tempIndex%3] = totalAbsValue;
float temp = 0.0f;
for( int i=0; i<3; ++i )
temp += tempFloatBuffer[i];
Now I am able to detect voice input coming from the audio recorder and I can analyse the audio buffer.
The buffer is converted to an float value and if it increases by a certain amount, it is assumed that there is some sound in the background and recording is started. But the problem is that the app starts recording all background noise, including fan/AC duct sounds.
Can anyone help me with analysing the buffer to detect human voice only? Or are there any other alternative ways to detect human voice from the audio recorder input?
Thanks in advance,
For voice detect, try ftt algorithm. For noise, try speex library. Show activity on this post. The more Filtering the better less noise More recognition, but be wary in filtering because it can also remove the Voice together with the noise.
Braina is a personal A.I. that you can use to communicate with your computer through your Android or IOS device. The program can convert your voice into text for any website or software program, including word processing ones.
Voice detection is not that simple. There are several algorithms, some of them are published, for example GSM VAD. Several open source VAD libraries are available, some of them are discussed here
For voice detect, try ftt algorithm.
For noise, try speex library.
If you want to have a clean recording you can
2.After Filtration the noise would be decreased and you can use Voice recognition API's
API's
The more Filtering the better less noise More recognition, but be wary in filtering because it can also remove the Voice together with the noise.
Also read more about FFt
Fast Fourier Transform of Human Voice
Hope This Helps :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With