简体   繁体   English

使用谷歌语音识别时忽略背景音乐

[英]Ignore background music when using google voice recognition

I'm trying to make an alarm clock Android app that could be stopped with voice recognition. 我正在尝试制作一个可以通过语音识别停止的闹钟Android应用程序。 For that, I'm using the Google Speech Recognition API (+ this code to do voice recognition continuously). 为此,我正在使用Google语音识别API(+ 此代码可以连续进行语音识别)。

It works fine, until I play music at the same time. 它工作正常,直到我同时播放音乐。 The voice recognition becomes way less efficient in this case. 在这种情况下,语音识别效率降低。

This problem is logical, since the music adds some noise which makes recognition harder. 这个问题是合乎逻辑的,因为音乐会增加一些噪音,使得识别变得更难。 But since the music played is known, I was wondering if it was possible to tell Google to try to ignore these additional noise. 但由于播放的音乐是众所周知的,我想知道是否有可能告诉谷歌试图忽略这些额外的噪音。 I know there exists some filter in signal processing to do that (like Kalman filter or Wiener filter ). 我知道在信号处理中存在一些过滤器(如卡尔曼滤波器维纳滤波器 )。

So my question is: Is it possible to apply a filter with Google voice recognition to ignore a known noise? 所以我的问题是: 是否可以应用具有Google语音识别功能的过滤器来忽略已知的噪音? Or is there another voice recognition library that allows that? 或者是否有另一个允许的语音识别库?

Edit: It's not a duplicate, since the problem is not the same. 编辑:这不是重复,因为问题不一样。 But interesting suggestion though. 但有趣的建议虽然。

Google Voice Recognition will already be optimised to detect speech, regardless of any background ambient noise 'type'. 无论背景环境噪音是什么类型,谷歌语音识别都已经过优化,可以检测语音。

Rather than using Google's native Voice Recognition, supplied via their 'Now/Assistant' application, you can use their Cloud Speech API which offers some enhancements. 您可以使用其Cloud Speech API提供一些增强功能,而不是使用通过其“现在/助理”应用程序提供的Google原生语音识别功能。

The recognizer is designed to ignore background voices and noise without additional noise-canceling. 识别器设计用于忽略背景声音和噪声而无需额外的噪声消除。 However, for optimal results, position the microphone as close to the user as possible, particularly when background noise is present. 但是,为获得最佳效果,请将麦克风放置在尽可能靠近用户的位置,尤其是在存在背景噪音时。

The above is no doubt true generally across their Voice Recognition System. 毫无疑问,上述语音识别系统通常都是如此。

Use word and phrase hints to add names and terms to the vocabulary and to boost the accuracy for specific words and phrases. 使用单词和短语提示为词汇表添加名称和术语,并提高特定单词和短语的准确性。

For short queries or commands, use StreamingRecognize with single_utterance set to true. 对于简短查询或命令,请使用StreamingRecognize并将single_utterance设置为true。 This optimizes the recognition for short utterances and also minimizes latency. 这样可以优化对短话语的识别,并最大限度地减少延迟。

https://cloud.google.com/speech/docs/best-practices https://cloud.google.com/speech/docs/best-practices

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM