我正在尝试控制用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之外的任何其他格式。
答案 0 :(得分:1)
我认为AVEncoderAudioQualityKey
不适用于kAudioFormatAppleLossless
而AVEncoderBitDepthHintKey
仅适用于。
也许通过较低级别的CoreAudio AudioConverter
API,您可以更好地在ALAC中获取8位音频。