AudioUnitInitialize failed with error code 1701737535 'ent?' after alarm interruption

旧城冷巷雨未停 提交于 2019-12-24 22:04:44

问题


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:


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 })


来源:https://stackoverflow.com/questions/49877932/audiounitinitialize-failed-with-error-code-1701737535-ent-after-alarm-interru

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!