iPhone:准确识别人声

发布于 2024-11-02 10:28:20 字数 1136 浏览 1 评论 0原文

我正在开发一个应用程序,我需要识别人类(准确地说是婴儿哭声)的声音。我参考了以下关于在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浊酒尽余欢 2024-11-09 10:28:20

这是一个非常困难的问题。语音识别是一个复杂的课题,即使是大公司也无法做好。建议对其进行采样,看看它是否在某个特定的高音范围内。除此之外,您还需要阅读语音识别理论。

正如这个答案所示,它不在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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文