AVAudioRecorder init, iOS 13.1.1, iOS 13.1.2

I am not sure what is going on but I cannot seem to initialize a AVAudioRecorder object successfully, given certain audio settings for a device above iOS 13.0

Xcode 11

Swift 5

AudioKit pod v4.9(just FYI, dont think this is the problem)

//audio Settings


private let audioSettings = [
  AVFormatIDKey : Int(kAudioFormatMPEG4AAC),
  AVSampleRateKey : 44100,
  AVNumberOfChannelsKey : 2,
  AVEncoderAudioQualityKey : AVAudioQuality.medium.rawValue
  ]


do {
  audioRecorder = try AVAudioRecorder(url: actualRecordingPath, settings: audioSettings)
  audioRecorder?.record()
  state = .recording
  try AudioKit.start()
  timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(timerDidUpdate), userInfo: nil, repeats: true)
  } catch let error{
  print("start recording", error.localizedDescription)
  return
  }



The following error(s) are displayed:

AVAudioEngine.mm:160 Engine@0x2835411b0: could not initialize, error = -10868

AVAEInternal.h:109 [AVAudioEngineGraph.mm:1397:Initialize: (err = AUGraphParser::InitializeActiveNodesInInputChain(ThisGraph, *GetInputNode())): error -10868 Blockquote

AudioKit+StartStop.swift:restartEngineAfterConfigurationChange(_:):160:error restarting engine after route change



i was able to find this link:

https://www.osstatus.com/search/results?platform=all&framework=all&search=-10868and its looking like maybe a format is not supported?

Anyone got any idea what's going on here? Again, no error on iOS 13.0, just doesn't work on 13.0+

Replies

I did some more testing under XCode 11.1 GM and everything works on iOS 13.1 for all devices. It fails to work on 13.1.1 and 13.1.2. Unfortunately I dont think you can test patches or get them on simulator. Anyone got any suggestions?