iPhone:准确识别人声
我正在开发一个应用程序,我需要识别人类(准确地说是婴儿哭声)的声音。我参考了以下关于在 iPhone 麦克风上录制声音的文章并对其进行了采样。
http://mobileorchard.com/tutorial-detecting-当用户向麦克风吹气时/ http://developer.apple.com/library/ios/#samplecode/aurioTouch/Introduction/Intro.html http://developer.apple.com/library/ios/ #samplecode/SpeakHere/Introduction/Intro.html
...但我不知道如何准确区分人声和其他声音。任何有关此的帮助或示例代码都会非常有帮助。
到目前为止我写了以下代码:
-(void)levelTimerCallback:(NSTimer *)timer {
[recorder updateMeters];
const double ALPHA = 0.05;
double peakPowerForChannel = pow(10, (0.05 * [recorder peakPowerForChannel:0]));
lowPassResults = ALPHA * peakPowerForChannel + (1.0 - ALPHA) * lowPassResults;
NSLog(@"frequency: %f", lowPassResults);
NSLog(@"Average input: %f Peak input: %f", [recorder averagePowerForChannel:0], [recorder peakPowerForChannel:0]);
if (lowPassResults < 0.95)
[self playSound];
}
谢谢。
I am developing an application where I need to recognize human(to be precise baby crying) voice. I referred following articles for recording sound on iPhone microphone and sample it.
http://mobileorchard.com/tutorial-detecting-when-a-user-blows-into-the-mic/
http://developer.apple.com/library/ios/#samplecode/aurioTouch/Introduction/Intro.html
http://developer.apple.com/library/ios/#samplecode/SpeakHere/Introduction/Intro.html
...but I didn't get how can I accurately distinguish the human voice from any other voice. Any help or sample code on this would be really helpful.
So far I wrote following code:
-(void)levelTimerCallback:(NSTimer *)timer {
[recorder updateMeters];
const double ALPHA = 0.05;
double peakPowerForChannel = pow(10, (0.05 * [recorder peakPowerForChannel:0]));
lowPassResults = ALPHA * peakPowerForChannel + (1.0 - ALPHA) * lowPassResults;
NSLog(@"frequency: %f", lowPassResults);
NSLog(@"Average input: %f Peak input: %f", [recorder averagePowerForChannel:0], [recorder peakPowerForChannel:0]);
if (lowPassResults < 0.95)
[self playSound];
}
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个非常困难的问题。语音识别是一个复杂的课题,即使是大公司也无法做好。建议对其进行采样,看看它是否在某个特定的高音范围内。除此之外,您还需要阅读语音识别理论。
正如这个答案所示,它不在iPhone SDK的范围内,所以这不是一个简单的答案。
This is a very difficult problem. Speech recognition is a complex subject, and even massive companies can't get it right. A suggestion would be to sample it and see if it is within a certain, high-pitched range. Beyond that, you would need to read up on speech recognition theory.
As this answer shows, it is not within the range of the iPhone SDK, so it will not be a simple answer.