AudioKit - Stereo channel flipping from input to output?

你。 提交于 2019-12-08 02:07:45

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!