简体   繁体   中英

IOS CallKit Audio issue

i have developed ios voip applicaion using pjsip Lib. in this app incomming view i am using callkit with pushkit here audio and mic not working in ios 10.2 version

Can't tell the reason from your description. But I once had audio issue dealing with CallKit. One thing to be careful is that you should manage your audio session settings only in

- (void)provider:(CXProvider *)provider didActivateAudioSession:(AVAudioSession *)audioSession

and

- (void)provider:(CXProvider *)provider didDeactivateAudioSession:(AVAudioSession *)audioSession

If you happened to manage your audio session settings or audio unit stuff else where, it may cause a lot of different audio problems.

For incoming SIP call, make sure that until user answers the call, the call audio I/O is not running . This is crucial stuff.

When CXProvider responds with

func provider(_ provider: CXProvider, perform action: CXAnswerCallAction)

Configure AVAudioSession there (set sample rate to 44100, buffer to 0.0005 and category PlayAndRecord with mode of VoiceChat)

fulfill the action, which will elevate the AVAudioSession priority and CXProvider will respond with

func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession)

There you start call audio processor (for pjsip, it's someting like pjsua_set_snd_dev(-1, -2) )

Make sure to stop sound device when CXProvider responds with

func provider(_ provider: CXProvider, didDeactivate audioSession: AVAudioSession)

And it is recommended to stop sound device in sip_init() , like pjsua_set_no_snd_dev() when using CallKit

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM