This has been asked before, but no one seemed to have a solution: Muting SpeechRecognizer's beep sound
Nevertheless, I still would like to know if anyone knows how to mute the beeping sound for SpeechRecognizer?
I create speechRecognizer object: private SpeechRecognizer sr = SpeechRecognizer.createSpeechRecognizer(this);
And then in my class I instantiate the speechRecognizer like this
sr.setRecognitionListener(new listener());
Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
i.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getApplication()
.getClass().getName());
i.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 6);
i.putExtra(RecognizerIntent.EXTRA_PROMPT, "");
i.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS, 7000);
sr.startListening(i);
Anyone with any good ideas? I researched that I could create an object of AudioManager (AudioManager mAudioManager) and then using setStreamSolo(), I could mute the sound. But I am not sure how to implement this. I added it to my instantiation code for speechRecognizer and nothing happened. Is this something I should call from my main class?
mAudioManager.setStreamSolo(AudioManager.STREAM_VOICE_CALL, true);
Thank you in advance.