I want use wired headset as audio source for SpeechRecognizer
. I read questions like Android - Getting audio to play through earpiece and Android - Play audio from earpiece. Finally i come to:
public void holdAudioStream(){
audioManager.setMode(AudioManager.STREAM_VOICE_CALL);
audioManager.setSpeakerphoneOn(false);
}
public void releaseAudioStream(){
audioManager.setMode(AudioManager.MODE_NORMAL);
audioManager.setSpeakerphoneOn(true);
}
but this don't work. Problem solved for Bluetooth headset by using
audioManager.setMode(AudioManager.STREAM_VOICE_CALL);
audioManager.startBluetoothSco();
audioManager.setBluetoothScoOn(true);
I'm not found alternative audioManager.startBluetoothSco();
for wired headset. Is there a possibility combination SpeechRecognizer
and wired headset?