Disable 'Ready' sound of recognition listener

后端 未结 2 904
旧时难觅i
旧时难觅i 2021-02-15 04:17

I implement a RecognitionListener inside of a tabbed fragment activity. What happens is that as the user scrolls around, the fragment that implements the listener is created/des

2条回答
  •  不思量自难忘°
    2021-02-15 04:35

    Previous answer is OK except it will crash because of a NullPointer Exception (getStreamVolume is being called on a null object). To fix that, before the getStreamVolume line add:

    AudioManager mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);

提交回复
热议问题