小编ben*_*lak的帖子

iOS 8中的AVAudioRecorder不处理kAudioFormatMPEG4AAC

我的代码工作正常,直到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)

objective-c avfoundation avaudioplayer ios ios8

5
推荐指数
1
解决办法
1483
查看次数

标签 统计

avaudioplayer ×1

avfoundation ×1

ios ×1

ios8 ×1

objective-c ×1