静音Google语音识别蜂鸣声 [英] Muting the Google voice recognition beep sound

查看:142
本文介绍了静音Google语音识别蜂鸣声的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个测试应用程序,该应用程序连续使用Google语音,并且每次调用Google识别服务时都会播放提示音.我正在尝试消除蜂鸣声.我已经读过一些使音乐流静音的线程,但这对我不起作用.

I have a test app that uses Google voice in a continuous manner and it plays the beep sound every time Google recognition service is called. I am trying to get rid of the beep sound. I have read threads of muting the music stream but that would not work for me.

我试图找到蜂鸣声文件的位置,所以我可以将其从系统中删除.我遵循了线程,但是我无法在5.0系统文件中看到该文件.

I am trying to find the beep file location so I could just go and delete it from the system. I followed this thread, but I cannot see the file in 5.0 system file.

推荐答案

假设您不想对所有流静音,因为您有兴趣播放自己的声音,因此这可能是适合您的解决方案:使用 Audio Focus API .

Assuming you don't want to mute all streams because you are interested in playing your own sound, this might be a solution for you: Use the Audio Focus API.

所以您会遇到这样的事情:

So you would have something like this:

AudioManager am = mContext.getSystemService(Context.AUDIO_SERVICE);
...
// Request audio focus for playback
int result = am.requestAudioFocus(afChangeListener,
                             // Use the music stream.
                             AudioManager.STREAM_MUSIC,
                             // Request permanent focus.
                             AudioManager.AUDIOFOCUS_GAIN);

if (result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
am.registerMediaButtonEventReceiver(RemoteControlReceiver);
// Play your own sound (or play silence)
}
am.abandonAudioFocus(afChangeListener);

我尚未测试Google应用程序(播放蜂鸣声)是否符合此请求,但通常应该可以正常工作,值得一试.

I have not tested, whether the Google App (which plays the beep sound) adheres to this request, but generally it should work and its worth giving it a try.

另一种选择是直接使所有来自Google App的声音(包括Google语音识别蜂鸣声)静音.此方法的优点是不会干扰任何其他流音频.以下是更多详细信息的链接.请注意,但是,这需要root用户访问权限: ​​ https://android. stackexchange.com/questions/128588/how-do-i-disable-the-google-voice-typing-voice-search-ding-sound .

Another option would be to directly mute all sounds coming from the Google App (which includes the Google voice recognition beep sound). The advantage of this method is that there is no interference with any other streaming audio. The following is a link for further detail. Do note, however, that this requires root access: https://android.stackexchange.com/questions/128588/how-do-i-disable-the-google-voice-typing-voice-search-ding-sound.

这篇关于静音Google语音识别蜂鸣声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆