WebRTC iOS - Audio is routed to internal speakers after connection is established between two peers

722 views
Skip to first unread message

Arnold Plakolli

unread,
Nov 7, 2017, 2:04:55 AM11/7/17
to discuss-webrtc
Hello everyone,

I'm working on a audio/video/chatting app, and I've got some issues with the way AVAudioSession is handled by WebRTC. 
I am specifically overriding the audio port so that audio goes through loud speakers using this: "AVAudioSession.sharedInstance().overrideOutputAudioPort(.speaker)", but after peer connection gets established (Meaning it's ICE state changes to "Connected") somehow WebRTC changes audio route to go through internal speakers. I want audio to not change route just because I get connected to another peer.
Maybe I'm missing some obvious thing in the API? Can anybody help me?

Saúl Ibarra Corretgé

unread,
Nov 7, 2017, 4:26:07 AM11/7/17
to discuss...@googlegroups.com
The override will be reset when the session is reconfigured. You are better off choosing the right category / mode / options combo. If you choose the video chat mode, it defaults to the speaker, for instance.


Cheers,

--
Saúl

Henrik Andreasson

unread,
Nov 7, 2017, 4:34:25 AM11/7/17
to discuss-webrtc
WebRTC does not "handle" the audio session but leaves it to the client.
One example of calling overrideOutputAudioPort is in the AppRTCMobile demo client here:


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/FEDD12C2-B3D5-403F-A9D4-2E8CC3FD0457%40atlassian.com.
For more options, visit https://groups.google.com/d/optout.

arnold....@solaborate.com

unread,
Nov 8, 2017, 2:56:34 AM11/8/17
to discuss-webrtc
Thanks, I'll try that.
Reply all
Reply to author
Forward
0 new messages