在数组中连接不同的 AudioKit Effects

Connecting different AudioKit Effects in array

我有一组 AudioKit 效果器,可以灵活地 add/remove 或更改它们的顺序,将它们存储为 AKNode

var effects : [AKNode] = []

effects.append(AKCompressor())
effects.append(AKDelay())
effects.append(AKAutoWah())
... ...

问题在于连接:

effects[0].connect(to: effects[1])

它不起作用:无法使用类型为“(to: AKNode)”的参数列表调用 'connect'

也许我应该存储其他 class 而不是 AKNode。最好的方法是什么?

使用一组 AKInputs。 connection functions use the AKInput and AKOutput 协议。 AKInput 继承自 AKOutput,因此它们也是输出。