适用于os x的kAppleSoftwareAudioCodecManufacturer模拟

时间:2016-01-26 10:33:47

标签: objective-c macos core-audio audiounit avaudioengine

所以我尝试使用此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);

那有什么不对?

0 个答案:

没有答案