Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local Audio playback switches to receiver from LoudSpeaker when call connects #588

Open
dericpr opened this issue Feb 2, 2021 · 0 comments

Comments

@dericpr
Copy link

dericpr commented Feb 2, 2021

Description

Playback of local audio either stops or is directed to the receiver from the loudspeaker once a Peer to Peer Room connects. We have a metronome application in our video call and it needs to playback locally and mix with the audio from the incoming client as well.

I'm also seeing local audio fail completely after call is terminated. Is there some audio cleanup code I need to call to enable local audio after disconnecting the Twilio call?

Steps to Reproduce

  1. Start playback of local audio using AVAudioPlayer, playback comes from loud speaker
  2. Start a call and connect with a session
  3. Local audio switches from loud speakers to the receiver automatically and volume decreases.

Code

// TwilioVideo.audioDevice must be assigned prior to any audio or video track creation.
let audioDevice = DefaultAudioDevice()
TwilioVideoSDK.audioDevice = audioDevice
audioDevice.block = {
do {
try AVAudioSession.sharedInstance().setCategory(.playAndRecord, mode: .videoChat, options: [.mixWithOthers, .defaultToSpeaker])
try AVAudioSession.sharedInstance().overrideOutputAudioPort(.speaker)
} catch {
print(error)
}
}

    // Execute the block to apply settings on AVAudioSession
    audioDevice.block();

Expected Behavior

Local Audio playback should continue to come out the loudspeaker along with the call audio.

Actual Behavior

Local Audio playback switches to receiver and is barley audible over the call audio.

Reproduces How Often

100%

Versions

All relevant version information for the issue.

Video iOS SDK

4.2.0

Xcode

12.3

iOS Version

14.3

iOS Device

iPad Pro, iPad mini, iPad 8th gen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants