所有 我想要记录mp2文件。
var recordSettings = [ AVFormatIDKey:kAudioFormatMPEGLayer2, AVEncoderAudioQualityKey:AVAudioQuality.Max.toRaw(), AVEncoderBitRateKey:320000, AVNumberOfChannelsKey:2, AVSampleRateKey:44100.0 ]
我的录音设置如上所述(swift)。 但是app崩溃了。我收到以下错误, "操作无法完成(OSStatus错误1718449215)"
答案 0 :(得分:0)
检查:https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html#//apple_ref/doc/uid/TP40009767-CH2-SW49了解可用的录制格式。 MPEG图层I,II和III不在列表中。如果您使用例如kAudioFormatMPEG4AAC,它将起作用。
编辑:BTW以了解错误代码的含义。例如" 1718449215" - 将其转换为十六进制字符串 - 您将得到66 6d 74 3f'。那相当于ascii字符' fmt?'