所以我尝试使用这种方法保存我的音频。但我在 os x 上需要它。在这种方法中,男性使用:
UInt32 codecManufacturer = kAppleSoftwareAudioCodecManufacturer;
status = ExtAudioFileSetProperty(
audioFile, kExtAudioFileProperty_CodecManufacturer, sizeof(UInt32), &codecManufacturer
);
status = ExtAudioFileSetProperty(
audioFile, kExtAudioFileProperty_ClientDataFormat, sizeof(AudioStreamBasicDescription), audioDescription
);
status = ExtAudioFileWriteAsync(audioFile, 0, NULL);
只有当我使用 IPHONE 时它才有效。所以我尝试在 OS X 上找到类似的东西。我有这段代码,但它不起作用:
UInt32 codecManufacturer2 = kAudioDecoderComponentType;
status = ExtAudioFileSetProperty(audioFile, kAudioFormatProperty_Decoders, sizeof(UInt32), &codecManufacturer2);
status = ExtAudioFileSetProperty(audioFile, kExtAudioFileProperty_ClientDataFormat, sizeof(AudioStreamBasicDescription), audioDescription);
status = ExtAudioFileWriteAsync (audioFile, 0, NULL);
那么有什么问题呢?