If you use the button to activate and deactivate the recognizer, you can turn off the onclick sound. It doesnβt work fantastically if you constantly listen to it, however for clicks on a button this should be good :)
private AudioManager manager; manager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); if (isChecked) { manager.setStreamMute(AudioManager.STREAM_MUSIC, true); speech.startListening(recognizerIntent); } else { manager.setStreamMute(AudioManager.STREAM_MUSIC, false); speech.stopListening(); speech.cancel(); }
Hope this helps (sorry if this is abit of necrothread)
Aphire
source share