Continues Speech Recognition beep sound after Google Search update

后端 未结 3 1843
轻奢々
轻奢々 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:44

    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

    
    

提交回复
热议问题