从音频文件输入检测人声 [英] Detect human voice from audio file input

查看:1195
本文介绍了从音频文件输入检测人声的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现自动语音录制功能,类似的会说话的汤姆应用程序。我用下面的code,从录音机读取输入和分析缓存:

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?

在此先感谢,

推荐答案

语音检测并非如此简单。有多种算法,有的则是公布的,例如 GSM VAD 。有几个开源VAD库可用,他们中的一些讨论<一href="http://dsp.stackexchange.com/questions/2386/libraries-for-voice-activity-detection-not-speech-recognition">here

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

这篇关于从音频文件输入检测人声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆