更新後:ComponentDescription desc;desc.componentType = kAudioUnitType_Effect;desc.componentSubType = kAudioUnitSubType_MatrixReverb;desc.componentManufacturer = kAudioUnitManufacturer_Apple;desc.componentFlagsMask = 0;desc.componentFlags = 0;Component comp = NULL;comp = FindNextComponent(comp,&desc);AudioUnit unit;OSStatus err = OpenAComponent(comp, &unit);NSAssert(err == noErr, @"");err = AudioUnitInitialize(unit);NSAssert(err == noErr, @"");
AudioComponentDescription desc;desc.componentType = kAudioUnitType_Effect;desc.componentSubType = kAudioUnitSubType_MatrixReverb;desc.componentManufacturer = kAudioUnitManufacturer_Apple;desc.componentFlagsMask = 0;desc.componentFlags = 0;AudioComponent comp = NULL;comp = AudioComponentFindNext(comp,&desc);AudioUnit unit;OSStatus err = AudioComponentInstanceNew(comp, &unit);NSAssert(err == noErr, @"");err = AudioUnitInitialize(unit);NSAssert(err == noErr, @"");
ComponentDescription -> AudioComponentDescription
Component -> AudioComponent
FindNextComponent() -> AudioComponentFindNext()
OpenAComponent()-> AudioComponentInstanceNew()
ComponentResult -> OSStatus
CloseComponent() -> AudioComponentInstanceDispose()