本文介绍了如何忽略SpeechRecognizer的蜂鸣声?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此之前已经问过,但似乎没有人有一个解决办法:
Is可以在android系统编程关闭静音模式?
全球声音
在我看来,该code是不同,这取决于Android版本 - 作为第一个环节表示,谷歌跳槽的嘟嘟媒体流的输出
It seems to me that the code is different depending on the android version - as stated in the first link, Google switched the output of the 'beep' to the media stream.
我猜那些问题之一将有解决方案。如果是的话请发表你做了什么,你说很多人似乎有问题。
I am guessing one of those questions will have the solution. If so please post what you have done, as you stated many people seem to be having the problem.
我的猜测是:
//mute audio
AudioManager amanager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
amanager.setStreamMute(AudioManager.STREAM_NOTIFICATION, true);
amanager.setStreamMute(AudioManager.STREAM_ALARM, true);
amanager.setStreamMute(AudioManager.STREAM_MUSIC, true);
amanager.setStreamMute(AudioManager.STREAM_RING, true);
amanager.setStreamMute(AudioManager.STREAM_SYSTEM, true);
//unmute audio
AudioManager amanager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
amanager.setStreamMute(AudioManager.STREAM_NOTIFICATION, false);
amanager.setStreamMute(AudioManager.STREAM_ALARM, false);
amanager.setStreamMute(AudioManager.STREAM_MUSIC, false);
amanager.setStreamMute(AudioManager.STREAM_RING, false);
amanager.setStreamMute(AudioManager.STREAM_SYSTEM, false);
我想从证人应用程序的用户将工作这个答案。幸得:@WitnessApplications
I imagine this answer from Witness applications user will work. Credit goes to: @WitnessApplications
另外这个范围会之前,你startListening(I);
这篇关于如何忽略SpeechRecognizer的蜂鸣声?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!