I have a stereo audio file for which I try to separate the audio channels. Resulting in a bus with the left audio, and a bus with the right audio signal. On these channels I want to do some operations and then merge them again to a single stereo signal.
Reading the audio file, doing operations on the bus and merging it to a single signal is no problem (though I haven't tested if this signal is stereo, as it depends on the prior channels I guess).
My problem is in separating the left and the right channel, so I can independently modify them.
One of my ideas was to use the pan
property of AVAudioPlayerNode
to have the signal only left/right, but it seems like (as mentioned in the documentation) this property is not yet implemented in the AVAudioPlayerNode
(Even though in all the examples of the WWDC videos it is used).
Another solution I found was this. Using memcpy
to create new buffers. I haven't tried this yet as I guess this takes quite some time and is not suitable for a normal player.
Third there is a framework called audiokit. This provides the option of converting the stream to mono left/right channel and then merging the signal again by creating an AKStereoOperation
. My problem with this solution is, it is quite a simple use-case. Separating the audio channels. For this I find it hard to justify including such a huge framework, even though it would probably work (not tested).
Is there a simple way to separate the channels?
Thanks!