twilio / audioswitch

An Android audio management library for real-time communication apps.
Apache License 2.0
160 stars 49 forks source link

After selecting a bluetooth device, the AudioDeviceChangeListener is called first with selectedAudioDevice = BluetoothHeadset (correct) and then with selectedAudioDevice = Earpiece(without user selection) a few seconds later #119

Closed akardas16 closed 2 years ago

akardas16 commented 2 years ago

Hi, I saw that you discussed this issue but I can still reproduce this bug every time. even though selected device routes to Earpiece, I still receive call audio from Bluetooth.

Also on android 12 sometimes we receive voice over bluetooth, other times we receive voice from speaker or Earpiece while we already connected to a bluetooth device

pegurin commented 2 years ago

Same issue here with Samsung A72, Android 11 and Galaxy Buds Live as bluetooth device.

robholmes commented 2 years ago

I see exactly the same issue of switching to BT headset and hearing the call audio, but then after a few seconds the AudioDeviceChangeListener is called having switched back to Earpiece, even though the call audio is still routed over BT.

version: com.twilio:audioswitch:1.1.4 device: Samsung Galaxy Tab Active 2 android: 9 BT headset: Bose QC-35 II

afalls-twilio commented 2 years ago

Thank you @robholmes for submitting a fix for this issue its greatly appreciated. It has been tested and your MR has been merged.