NSMutableDictionary *setting = [NSMutableDictionary dictionary];
[setting setValue:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey];//音乐格式
[setting setValue:[NSNumber numberWithFloat:8000.0] forKey:AVSampleRateKey];//音乐采样率
[setting setValue:[NSNumber numberWithInt:1] forKey:AVNumberOfChannelsKey];//音乐通道数
[setting setValue:[NSNumber numberWithInt:1] forKey:AVEncoderBitRateKey];//音频比特率
[setting setValue:[NSNumber numberWithInt:1] forKey:AVEncoderBitRatePerChannelKey];//标识每通道的音频比特率
self.recorder = [[[AVAudioRecorder alloc]initWithURL:recordedFile settings:setting error:nil]autorelease];
AVAudioRecorder相关参数
最新推荐文章于 2023-03-15 22:29:59 发布