AVAudioUnit
をインスタンス化する方法はこれですので:AVAudioUnitをサブクラス化するにはどうすればいいですか?
[AVAudioUnit instantiateWithComponentDescription:componentDescription options:0 completionHandler:^(__kindof AVAudioUnit * _Nullable audioUnit, NSError * _Nullable error) {
}];
は、どのように私はAVAudioUnit
をサブクラス化することが出来るのですか?私はこれを試してみました:
[MySubclassOfAVAudioUnit instantiateWithComponentDescription:componentDescription options:0 completionHandler:^(__kindof AVAudioUnit * _Nullable audioUnit, NSError * _Nullable error) {
}];
しかし、ブロックに返されaudioUnit
はMySubclassOfAVAudioUnit
タイプAVAudioUnit
のままですとNOT。
毎のリズムFistmanの応答、私はAppleのサンプルコードで私のカスタムAUAudioUnit
サブクラスを登録しています:
componentDescription.componentType = kAudioUnitType_Effect;
componentDescription.componentSubType = 0x666c7472; /*'fltr'*/
componentDescription.componentManufacturer = 0x44656d6f; /*'Demo'*/
componentDescription.componentFlags = 0;
componentDescription.componentFlagsMask = 0;
私は私のAVAudioUnit
サブクラスはいつも私のAUAudioUnit
を使用します。
私の答えが間違っていたことに気付きました。あなたは 'AUAudioUnit'をサブクラス化して正しいタイプの' AVAudioUnit'サブクラスにラップさせることができます。私の更新された答えを見てください。 –