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+