AudioUnitInitialize failed with error code 1701737

2019-08-18 14:05发布

I am working with VOIP app. The app is working fine with CallKit.

I am facing an issue if alarm fires within call. Every time when alarm stop firing (Audio Interruption ends), we are trying to setActive: on AVAudioSession. But it always gives an error with code 1701737535 ie. 'ent?'.

The same error occurs when I am trying to initialize Audio Unit. Without using CallKit it's working fine.

Anybody faced issue with activating Audio Session when Audio Interruption ends.

I am getting different error '!pri' 561017449 in the same scenario but this time Interruption occurred because of the Native Phone app.

Issues are 100% replicable. tried with many hit & trails like thread, delay or calling setActive:YES and without calling setActive:YES. But no luck.

Summarising here :

  1. Getting error 1701737535 ie. 'ent?' if interruption because of ALARM.

  2. Getting error 561017449 ie. '!pri' if interruption because of Native Call

Replicating only if using CallKit with VIOP.

Anybody help.

1条回答
做自己的国王
2楼-- · 2019-08-18 14:40

I've run into the same issue, the solution I've found and worked with me is to enable Audio session before reporting your new call.

// Activate audio session
  do {
    try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, mode: AVAudioSessionModeVoiceChat, options: [.mixWithOthers, .allowBluetoothA2DP])
    try AVAudioSession.sharedInstance().setActive(true)
  } catch {
  }
  provider.reportNewIncomingCall(with: currentCallID, update: update, completion: { error in })
查看更多
登录 后发表回答