Bluetooth headset management with VOIP App using OpenSL ES

56 views
Skip to first unread message

Claude Chausse-ccr

unread,
Jul 29, 2016, 11:33:11 AM7/29/16
to android-ndk

I am working on a VOIP application that is doing audio Streaming using openSL.


I cannot get any bluetooth Headset audio to work properly. 


AudioManager mode is set to MODE_IN_COMMUNICATION, I request audio focus with AudioManager.STREAM_VOICE_CALL, OpenSL playback configuration stream type is set to SL_ANDROID_STREAM_VOICE, and the recording preset is configured with SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION.


I also use device optimal samplingrate and buffersize. 


Everything works fine in speaker mode, with wired headset but when I connect a bluetooth headset I usually get audio playback for the microphone (input stream) is not working.  


For bluetooth, I call startBluetoothSco() when I detect a headset using BroadcastReceiver. (I also tried to use setBluetoothScoOn(true) but I am not sure I understand what it means. 


When I connect a Watch it is even worst because the Because I get Audio state to connect and immediatly after it disconnects and I get no audio even in playback. 


I am really out of ideas to fix that. 


Anyone has made a Voip App that is able to properly manage audio headsets dynamic changes. 


Anh Tuấn Hoàng

unread,
Dec 17, 2016, 2:45:32 PM12/17/16
to android-ndk


Vào 22:33:11 UTC+7 Thứ Sáu, ngày 29 tháng 7 năm 2016, Claude Chausse-ccr đã viết:
Hi bro, Do you solve this issue?  
Reply all
Reply to author
Forward
0 new messages