I've been doing a deep research about this and simply could not get any results. I have this recording application with a custom hardware for audio filtering, the audio is sent via bluetooth handsfree module to the android app and recorded. But I want to monitor the recording in the headphones connected to the jack. More or less this is what I've been trying but the only configurations I get working are listening on bluetooth hands free or listening over phone speakers (when I turn audioManager.setSpeakerphoneOn(false); on).
More or less this is the code:
audioTrack = new AudioTrack(AudioManager.MODE_IN_CALL,sampleRate,AudioFormat.CHANNEL_OUT_MONO,
AudioFormat.ENCODING_PCM_FLOAT,maxJitter, AudioTrack.MODE_STREAM);
audioManager.setMode(AudioManager.MODE_IN_CALL);
audioManager.setSpeakerphoneOn(false);
//audioManager.setWiredHeadsetOn(true);
audioManager.setBluetoothScoOn(true);
audioManager.startBluetoothSco();
For example, I have another fully functional configuration with a headphone jack to audio/mic splitter, but the challenge continues being the bluetooth:
audioTrack = new AudioTrack(AudioManager.MODE_IN_COMMUNICATION,sampleRate,AudioFormat.CHANNEL_OUT_MONO,
AudioFormat.ENCODING_PCM_FLOAT,maxJitter, AudioTrack.MODE_STREAM);
audioManager.setSpeakerphoneOn(false);
//audioManager.setWiredHeadsetOn(true);
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
So If anybody has experience with this type of issue the help would be really appreciated! Thank you very much!
from Use Android AudioManager to listen bluetooth mic in wired headphones?
No comments:
Post a Comment