静音SpeechRecognizer的蜂鸣声 [英] Muting SpeechRecognizer's beep sound
本文介绍了静音SpeechRecognizer的蜂鸣声的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用SpeechRecognizer API为我的应用程序,,每次它启动时,它扮演着嘟嘟声。
I'm using SpeechRecognizer API for my app, and everytime it starts, it plays "beep" sound.
我想知道如何忽略它,所以我可以实现我自己的。
I'd like to know how to mute it, So I could implement one of my own.
感谢。
推荐答案
如果您正在使用一个按钮来激活和关闭你可以静音的onclick识别器。
这不工作充满了想象,如果您有它不断地听,但是,对于按钮点击它应该是罚款:)
If you are using a button to activate and deactivate the recognizer you can mute sound onclick. This doesnt work fantastically if you have it listening constantly, however for button clicks it should be fine :)
private AudioManager manager;
manager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
if (isChecked)
{
manager.setStreamMute(AudioManager.STREAM_MUSIC, true);
speech.startListening(recognizerIntent);
}
else
{
manager.setStreamMute(AudioManager.STREAM_MUSIC, false);
speech.stopListening();
speech.cancel();
}
希望这有助于(抱歉,如果这是一个necrothread的升技)
Hope this helps (sorry if this is abit of a necrothread)
这篇关于静音SpeechRecognizer的蜂鸣声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文