Re: AVAudioEngine - Multichannel output does not play on channel 1 and 2
Re: AVAudioEngine - Multichannel output does not play on channel 1 and 2
- Subject: Re: AVAudioEngine - Multichannel output does not play on channel 1 and 2
- From: Dave Gibson <email@hidden>
- Date: Fri, 24 Feb 2017 10:02:56 +0000
Managed to get it sorted after much confusion and trial/error. Turns out that the channel layout was the culprit. So instead of the kAudioChannelLayoutTag_DiscreteInOrder tag, I used:
let multiChannelLayout = AVAudioChannelLayout(layoutTag:
kAudioChannelLayoutTag_Unknown | numChannels)
I had previously tried the unknown tag but had issues with it because unlike all of the other channel layouts, this mode retains the information in the output buffer with each pass. I was adding each of the input busses to the output buffers incrementally, which was quickly resulting in a wall of sound; I had incorrectly interpreted this as a bad channel layout. Erasing the contents of the output buffers at the start of render callback was the answer.
It seems AVAudioEngine can do a lot of what can be done with the Core Audio C API, and the Swift/Obj-C interface is much more friendly on the whole. However, if you want to work with anything other than stereo, these channel layouts are the biggest PITA about working with AVAudioEngine at the moment.
The AVAudioNode objects, particularly the mixer, seem to interpret and manipulate the information in the channels in all different ways depending on these settings, often resulting in silence at the output. Unfortunately, there seems to be no information about how these settings are interpreted in the graph :(
Anyway, hope that helps someone else down the line :)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden