We have an ambisonics renderer that requires 16 channel audio.
Everything works fine using AVAudioFile to read a wav file with AVAudioChannelLayout.init(layoutTag: kAudioChannelLayoutTag_HOA_ACN_SN3D | 16)
into AVAudioPCMBuffer
but the raw wav files are huge.
I can't find any compressed formats (lossy or lossless) that iOS is able to read at 16 channels. Whilst it seems possible to create an aac file with up-to 48 channels iOS doesn't seem able to decode anything with more than 8 channels (7.1) as far as I can tell?
I considered using 2x8 channel aac files, reading them into 2 buffers and then joining them but have been unable to figure out how to merge them back to 16 channels with the correct layout.
I'm currently experimenting with trying to use Ogg/Opus for the compression as an alternative but my experiments here have also been unsuccessful so far.
Any help anyone can give on how I could go about getting 16 channels of compressed audio out of a file (or files) and into an AVAudioPCMBuffer
with kAudioChannelLayoutTag_HOA_ACN_SN3D | 16
layout would be very amazing.