Continues Speech Recognition beep sound after Google Search update
Asked Answered
P

3

6

I have an app that keeps on listening to voice and converting it to commands using Google Voice API.

I have been using setStreamMute(AudioManager.STREAM_SYSTEM, true) to mute the beep and it worked until a couple of days ago before "Google Search" new update. Is there any workaround fix for it?

I know I can use setRingerMode(AudioManager.RINGER_MODE_SILENT), but maybe there is another method?

Psychrometer answered 11/2, 2014 at 12:8 Comment(0)
M
8

In the update they switched the output of the 'beep' to the media stream.

So you'll need to mute the AudioManager.STREAM_MUSIC

There's an enhancement request about it here

Morehead answered 14/2, 2014 at 4:2 Comment(1)
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> do not forget like me.Coterminous
T
3

Mute the beep by muting the notification sound:

(getSystemService(Context.AUDIO_SERVICE) as AudioManager).adjustStreamVolume(AudioManager.STREAM_NOTIFICATION, AudioManager.ADJUST_MUTE,0)

Make sure to unmute it after you start listening:

(getSystemService(Context.AUDIO_SERVICE) as AudioManager).adjustStreamVolume(AudioManager.STREAM_NOTIFICATION, AudioManager.ADJUST_UNMUTE,0)

Please note that there's a beep sound when the listening stops.

Thetic answered 16/5, 2020 at 5:37 Comment(0)
L
1

The beep sound can be muted by using AudioManager

AudioManager mAudioManager =(AudioManager)getSystemService(Context.AUDIO_SERVICE);
mAudioManager.setStreamMute(AudioManager.STREAM_MUSIC, true);

To unmute sound

AudioManager mAudioManager =(AudioManager)getSystemService(Context.AUDIO_SERVICE);
mAudioManager.setStreamMute(AudioManager.STREAM_MUSIC, false);

Also add permission to Manifest.xml

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
Lancer answered 23/1, 2019 at 5:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.