[ad_1]
I am making an attempt to grasp why AVAudioRecorder.report() crashing on iOS 12.4 simulator (I haven’t got 12.4 system now to test)
Cannot discover virtually any data about this particular crash
Right here is my AVAudioRecorder setup:
func startRecording() {
let dirPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as String
let recordName = "report.wav"
audioURL = URL(fileURLWithPath: dirPath + "/" + recordName)
do {
let recorder = attempt AVAudioRecorder(url: self.audioURL, settings: [:])
attempt audioSession.setCategory(.playAndRecord, choices: .defaultToSpeaker)
attempt audioSession.setActive(true)
audioRecorder = recorder
audioRecorder.isMeteringEnabled = true
audioRecorder.delegate = self
audioRecorder.prepareToRecord()
audioRecorder.report()
} catch {
self.finishRecording(success: false)
print(error)
}
}
I additionally test permissions earlier than report:
audioSession.requestRecordPermission { granted in
if granted {
self.recordTapped()
} else {
print("not granted")
}
}
All the data I get from error stack hint:
[ad_2]

