bascially, you'll need to do something like
@interface AudioEngine () {
AVAudioEngine *_engine;
AVAudioEnvironmentNode *_environment;
AVAudioPCMBuffer *_ouputBuffer;
NSMutableArray <AVAudioPlayerNode*> *_PlayerArray;
AVAudioPlayerNode *_soundPlayer;
AVAudioPCMBuffer *_soundBuffer;
bool _multichannelOutputEnabled
;
load a file and grab it from the buffer.
to split the stereo into multichannel, you need something like
outputLayoutTag = kAudioChannelLayoutTag_AudioUnit_2;
_multichannelOutputEnabled = true;
this '_multichannelOutputEnabled = true;' is usually set to false
then setup the algorithm to do something with your channels
AVAudio3DMixingRenderingAlgorithm renderingTHIS = _multichannelOutputEnabled ?
AVAudio3DMixingRenderingAlgorithmSoundField : AVAudio3DMixingRenderingAlgorithmEqualPowerPanning;
newPlayer.renderingAlgorithm = renderingTHIS;
somewhere in a view controller your might have something like this tied to an object in a game
[self.epicAudioEngine.updateListenerOrientation:AVAudioMake3DAngularOrientation([ang.x,ang.y,ang.z])
[self updateEulerAnglesAndListenerFromDeltaX:dX DeltaY:dY]
look through ffmpeg source code for libavformat,libavutil to get an idea of how to process audio