所以我尝试使用此method保存音频。但我需要在os x上使用它。在this method人中使用:
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);
那有什么不对?