Since the way to instantiate an AVAudioUnit
is this:
[AVAudioUnit instantiateWithComponentDescription:componentDescription options:0 completionHandler:^(__kindof AVAudioUnit * _Nullable audioUnit, NSError * _Nullable error) {
}];
How am I supposed to subclass AVAudioUnit
? I have tried this:
[MySubclassOfAVAudioUnit instantiateWithComponentDescription:componentDescription options:0 completionHandler:^(__kindof AVAudioUnit * _Nullable audioUnit, NSError * _Nullable error) {
}];
But the audioUnit
that is returned in the block is still of type AVAudioUnit
and NOT MySubclassOfAVAudioUnit
.
Per Rhythmic Fistman's response, I am registering my custom AUAudioUnit
subclass with Apple's example code:
componentDescription.componentType = kAudioUnitType_Effect;
componentDescription.componentSubType = 0x666c7472; /*'fltr'*/
componentDescription.componentManufacturer = 0x44656d6f; /*'Demo'*/
componentDescription.componentFlags = 0;
componentDescription.componentFlagsMask = 0;
I want my AVAudioUnit
subclass to always use my AUAudioUnit
.