2015年4月1日 星期三

[Android] Google Speech Recognition - Turn off the Beep tone


In [Android] Google Speech Recognition - using RecognizerIntent and 
[Android] Google Speech Recognition - Implement our own UI, we implement speech recognition in different ways.
However, it will have an annoying Beep tone before the recording of voice.
Personally, I think that it is acceptable since it can hint the user.
If you think that it is really annoying, your can turn it off by one the methods mentioned below:
AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
am.setStreamSolo(AudioManager.STREAM_VOICE_CALL, true);
sr.startListening(recognizerIntent);
Or
AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
am.setStreamMute(AudioManager.STREAM_SYSTEM, true);
sr.startListening(recognizerIntent);

沒有留言:

張貼留言