我想用aac格式初始化一个AVAudioRecorder。为此,我使用以下代码:
soundFilePath = [soundFilePath stringByAppendingPathExtension:@"aac"];NSURL *url =
[NSURL fileURLWithPath:soundFilePath isDirectory:FALSE];
NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init];
[recordSetting setValue:[NSNumber numberWithInt: 'aac '] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithInt:AVAudioQualityMin] forKey:AVEncoderAudioQualityKey]; //Encoder Settings
[recordSetting setValue:[NSNumber numberWithInt:AVAudioQualityMin] forKey:AVSampleRateConverterAudioQualityKey]; //Sample Rate Conversion Settings
_recorder = [[AVAudioRecorder alloc] initWithURL:url settings:recordSetting error:nil];为什么这个不起作用?如果我把aac改成ima4,Id就行了!
发布于 2010-06-17 19:23:57
“‘aac”不在预定义的格式it中,因此它不起作用。您可以查看支持的音频类型常量,以获得所有这些常量的列表。它们可以在here上找到
在常量secion。
https://stackoverflow.com/questions/2856058
复制相似问题