0

我已经按照苹果 xcode 示例录制语音音频文件。在我调整了几个参数后,我想要一个采样率为 16000 且音频通道为 1 的音频文件。但是,我无法实现。请高手帮忙。谢谢你。

[recordSetting setValue :[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithFloat:16000.0f] forKey:AVSampleRateKey];
[recordSetting setValue:[NSNumber numberWithInt:1 ] forKey:AVNumberOfChannelsKey]; //mono
[recordSetting setValue:[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey];
[recordSetting setValue:[NSNumber numberWithBool:0] forKey:AVLinearPCMIsFloatKey];

在此处输入图像描述

4

0 回答 0