I am trying to do something which in theory should be very simple, i.e. take the audio produced from a single AVAudioNode and route it to multiple outputs which are also AVAudioNodes. However, I do not see an classes that do this. This is essentially like a splitter object.
I want to do something like this:
import AVFoundation
class Router{
func connect(){
let node1 = mixerNode()
let node2 = mixerNode()
let node3 = mixerNode()
let engine = AVAudioEngine()
let format = node1.outputFormat(forBus: 0)
engine.attach(node1)
engine.attach(node2)
engine.attach(node3)
engine.connect(node1, to: node2, format: format)
engine.connect(node1, to: node3, format: format)
let connections = engine.outputConnectionPoints(for: node1, outputBus: 0)
print("Num connections = \(connections.count)")
}
However, the console shows that node1 is only attached to one node as it can only have only one output. Is there an object which allows multiple outputs?