问题
I'm using AudioKit to create an experimental iOS audio application. Currently, I'm trying to reroute the left channel of my AKStereoInput to the right channel of AudioKit.output, and the right channel of my AKStereoInput to the left channel of the output.
I was able to simply pan the signal, but I have a hard time splitting the input signal, swapping the left/right channels, and reconnecting them to the output. Any help is appreciated!
回答1:
This is trivial to do at C DSP Level, but I also think you can just use AudioKit's booster and pan nodes to do this. Assuming input is an AKNode:
leftSignal = AKBooster(input)
leftSignal.rightGain = 0
leftPannedRight = AKPanner(leftSignal, pan: 1)
rightSignal = AKBooster(input)
rightSignal.leftGain = 0
rightPannedLeft = AKPanner(rightSignal, pan: -1)
reverseMix = AKMixer(leftPannedRight, rightPannedLeft)
AudioKit.output = reverseMix
I haven't tested this but I think its right.
来源:https://stackoverflow.com/questions/48310223/audiokit-stereo-channel-flipping-from-input-to-output