twilio / voice-quickstart-android

Quickstart app for the Voice Android SDK
https://www.twilio.com/docs/api/voice-sdk/android/getting-started
MIT License
184 stars 140 forks source link

Audio leaking from speaker after voice call is disconnected while on bluetooth #593

Closed thepraveshsinghh closed 3 months ago

thepraveshsinghh commented 4 months ago

In my calling app I've been using AudioSwitch for quite sometime. Now I've implemented ConnectionService in the same way described in the quickstart project. However I'm facing audio leaking issue from speaker when a call is disconnected.

Description

When I'm listening songs on my bluetooth earphones and receive an incoming call, as soon as I disconnect the call the song is played from the speaker for a few seconds and it automatically switches back to bluetooth after those few seconds.(this is happening on my Samsung device consistently)

Steps to Reproduce

  1. Play a song on your mobile via bluetooth.
  2. When an incoming call is received, music stops, now pickup the call and disconnect it quickly.
  3. When the call disconnects the song is played via speaker instead of bluetooth and switches back to bluetooth after few seconds.

Expected Behavior

After call disconnection, song should be played via bluetooth.

Actual Behavior

After call disconnection, song is played via speaker for few seconds.

Reproduces How Often

Consistently on my Samsung SMF127G.

Versions

Android version : 11 Twilio Voice SDK version: 6.4.0 Twilio AudioSwitch version:1.1.8

Any kind of help or suggestions are appreciated. Thanks in advance.

afalls-twilio commented 4 months ago

@thepraveshsinghh Thanks for the bug report, this sounds like it may be an issue with AudioSwitch, and particular, the lag the device has when switching from/to SCO. We are currently investigating this.

thepraveshsinghh commented 4 months ago

@afalls-twilio @ocarevs Do we have any update on this?

afalls-twilio commented 4 months ago

@thepraveshsinghh we are still investigating.. we will report here when we have something to share

ocarevs commented 3 months ago

@thepraveshsinghh We've updated the conection_service app flavour in quickstart in the mentioned PR. AudioSwitch was conflicting with audio focus management and routing when using ConnectionService and thus we removed it.