Routing call audio through the bluetooth headset
See original GitHub issueHello there,
I would like to allow users to switch between different audio output sources (handset, speaker, Bluetooth). I can get this done for handset and speaker by calling audioManager.setSpeakerphoneOn
but how to do I handle the case where users want the audio to go through their Bluetooth headsets?
Issue Analytics
- State:
- Created 5 years ago
- Comments:21 (6 by maintainers)
Top Results From Across the Web
Route and automatically answer calls on iPhone - Apple Support
Route the audio of phone or FaceTime calls to the iPhone speaker, a Bluetooth headset, or your hearing devices. iPhone can also automatically...
Read more >How to Route iPhone Calls to Bluetooth Headset or Speaker
Open the Settings app on your iPhone. · Go to Accessibility settings. · Tap on Touch. · Next up, Select Call Audio Routing....
Read more >What is Call Audio Routing? - TRUCE Software
Most devices have options to determine how incoming and outbound audio are processed. These settings can affect the way your phone utilizes Bluetooth...
Read more >Why can't I answer calls through a Bluetooth device after ...
Before answering a phone call, change the audio route setting in Settings: swipe down to reveal the search field, search Call Audio Routing,...
Read more >How to Toggle a Bluetooth Headset During a Call in Android
Tap the "Bluetooth" toggle button in the lower left corner of the in-call dialer screen. The bar below the button fills with green...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@marklapasa
The SDK doesn’t provide bluetooth enabling API as part of the Voice Android SDK. However, this can be implemented in the application layer. In our test application we have adopted the AppRTC code provided by google.
https://webrtc.googlesource.com/src/+/master/examples/androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java https://webrtc.googlesource.com/src/+/master/examples/androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java
When a call starts you can add the following code to initialize
AppRTCAudioManager
andAppRTCBluetoothManager
.Here is the link to the code snippet in AppRTC, https://webrtc.googlesource.com/src/+/master/examples/androidapp/src/org/appspot/apprtc/CallActivity.java#583 to https://webrtc.googlesource.com/src/+/master/examples/androidapp/src/org/appspot/apprtc/CallActivity.java#595
In the manifest file, make sure to add the following permissions :
Try this out and let me know if this does not solve the issue.
@idelgado Has Bluetooth been fixed yet for android. I’ve tried a solution above and it works, except that it except for the following scenario. If you are listening to spotify using a bluetooth device, the twilio voice will take play through bluetooth device. However the call is done, it will not give back bluetooth audio to spotify, and is stuck on call.
I’ve tried a few things to fix this issue, however I have been unable to solve this.
I can’t continue debugging a this as this taking up my time from other things, and was hoping that twilio may have already fixed the solution, since it has been a while since this ticket is created. Let me know the status of this issue on your guys end.
Please and Thank you