AVRecorder无法设置位深度

时间:2015-04-08 01:55:07

标签: ios

我正在尝试控制用AVRecorder录制的.m4a文件的位深度:

NSDictionary *settings =  [NSDictionary dictionaryWithObjectsAndKeys:
                          [NSNumber numberWithFloat: 44100.0],                 AVSampleRateKey,
                          [NSNumber numberWithInt: kAudioFormatAppleLossless], AVFormatIDKey,
                          [NSNumber numberWithInt: 1],                         AVNumberOfChannelsKey,
                          [NSNumber numberWithInt: 8],         AVEncoderBitDepthHintKey,
                          nil];

AVEncoderBitDepthHintKey无效,AVEncoderAudioQualityKey也是如此。

似乎iOS7和8有不同的默认值:iOS7总是提供s16p格式(根据ffmpeg)和iOS8 s32p。

我不想使用除AppleLossless之外的任何其他格式。

1 个答案:

答案 0 :(得分:1)

我认为AVEncoderAudioQualityKey不适用于kAudioFormatAppleLosslessAVEncoderBitDepthHintKey 仅适用于

也许通过较低级别的CoreAudio AudioConverter API,您可以更好地在ALAC中获取8位音频。