Issue with voice in video call

174 views
Skip to first unread message

Bhavani Chada

unread,
Sep 23, 2021, 7:52:00 AM9/23/21
to discuss...@googlegroups.com
Hi
I have implemented a video calling application using webRTC.While connecting video calls in iOS with speaker getting a lot of noise and some metallic sound in the background.This is very annoying while talking.I'm using playandrecord category and voice chat mode for avaudiosession.Can anyone please help on this.

I'm using below code for audio player setting:

 do {
       
        try AVAudioSession.sharedInstance().setCategory(.playAndRecord, options: [.allowAirPlay,.allowBluetooth])
                 //   try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playAndRecord)
        try? AVAudioSession.sharedInstance().setMode(AVAudioSession.Mode.voiceChat)
                } catch let error as NSError {
                    print("setCategory error: \(error.localizedDescription)")
                }
     do { try AVAudioSession.sharedInstance().setActive(true,options: .notifyOthersOnDeactivation)
     }




--
Regards,
Bhavani Chada
iOS Developer
ISTPL
Mobile:9948043146
Hyderabad

John Mikelich

unread,
Oct 21, 2021, 4:55:43 PM10/21/21
to discuss-webrtc
What you are trying to do,  generally you don't want to mess with the shared audio session unless you're an expert in it. WebRTC does a ton of stuff with it, and all of it very intentional.

Is it just to get the sound out of the speakers? Just do something like this

[[AVAudioSession sharedInstance] overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:&error];

or

AVAudioSession.sharedInstance().overrideOutputAudioPort(.speaker)

other than that you shouldn't have to touch audio for webrtc.
Reply all
Reply to author
Forward
0 new messages