我的代码工作正常,直到iOS 8,kAudioFormatMPEG4AAC但现在它创建一个空文件.没有报告错误.当我把它更改为kAudioFormatLinearPCM它的工作原理.这是我的代码:
recordSettings = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:AVAudioQualityMin], AVEncoderAudioQualityKey,
[NSNumber numberWithInt: kAudioFormatLinearPCM], AVFormatIDKey,
[NSNumber numberWithInt:16], AVEncoderBitRateKey,
[NSNumber numberWithInt: 1], AVNumberOfChannelsKey,
[NSNumber numberWithFloat:32000.0], AVSampleRateKey,
nil];
Run Code Online (Sandbox Code Playgroud)