iphone sdk:AVAudioRecorder的初始化返回零
我想用aac格式初始化AVAudioRecorder。为此,我使用以下代码:iphone sdk:AVAudioRecorder的初始化返回零,iphone,avaudiorecorder,Iphone,Avaudiorecorder,我想用aac格式初始化AVAudioRecorder。为此,我使用以下代码: soundFilePath = [soundFilePath stringByAppendingPathExtension:@"aac"];NSURL *url = [NSURL fileURLWithPath:soundFilePath isDirectory:FALSE]; NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] ini
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就行了 “aac”不在预定义的格式ID中,因此不起作用。 您可以查看受支持的audiotype常量,以获得所有这些常量的列表。它们在实验室里 在第二节