Continues Speech Recognition beep sound after Google Search update

后端 未结 3 1848
轻奢々
轻奢々 2020-12-18 06:39

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

3条回答
  •  忘掉有多难
    2020-12-18 06:55

    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.

提交回复
热议问题