我正在尝试将类型的AudioUnit添加kAudioUnitSubType_Reverb2到一个AUGraph并且我得到一个-10868 (kAudioUnitErr_FormatNotSupported)支持的错误AUGraphInitialize.我的出发点是Apple的iPhoneMixerEQGraphTest示例应用程序,我基本上只是为混响添加了一个新的AudioUnit,但无法让它工作.
这是代码 -
- (void)initializeAUGraph
{
printf("initializeAUGraph\n");
AUNode outputNode;
AUNode eqNode;
AUNode mixerNode;
AUNode reverbNode;
printf("create client ASBD\n");
// client format audio goes into the mixer
mClientFormat.SetCanonical(2, true);
mClientFormat.mSampleRate = kGraphSampleRate;
mClientFormat.Print();
printf("create output ASBD\n");
// output format
mOutputFormat.SetAUCanonical(2, false);
mOutputFormat.mSampleRate = kGraphSampleRate;
mOutputFormat.Print();
OSStatus result = noErr;
// load up the audio data
[self performSelectorInBackground:@selector(loadFiles) withObject:nil];
printf("new AUGraph\n");
// create a new AUGraph
result = NewAUGraph(&mGraph);
if (result) { printf("NewAUGraph …Run Code Online (Sandbox Code Playgroud)