Mp4 aac multichannel files

I am running into an issue with multichannel mp4 files. The AAC format, encapsulated by mp4 supports up to 48 channels, but any more than 2 channels and fmod won’t load it. I get

FMOD error 19 - Unsupported file or audio format.

I tested with the play_sound example on iOS, using 2.01.09.

OGG and FLAC work fine with multichannel, but I would prefer to be using mp4 consistently.

Here is a demo 4 channel mp4 file: Dropbox - ambi-test.mp4 - Simplify your life

As of the time of writing (July of 2021), we are unable to support the aac audio format due to licencing issues.

I should mention that the encoding format of your source audio files is, by and large, unimportant. Whenever you build your banks, FMOD Studio encodes the bank in the formats you’ve specified in FMOD Studio, replacing any existing encoding in the process. The encoding format of your source audio assets therefore has no effect on your game’s audio output, behavior, or performance.

We don’t use FMOD Studio, just the Engine. It works with stereo mp4-AAC files just fine. In fact your documentation states you support AAC: https://www.fmod.com/resources/documentation-api?version=2.01&page=core-api-sound.html#fmod_sound_type

AAC IMHO offers the best quality to my ears, but in your mind, what’s the best alternative for multichannel playback that is supported by FMOD?

Any supported lossless high-quality format will do equally well as source audio files if you’re planning to build your audio into banks, whether you use FMOD Studio or not. As I mentioned earlier, the build process effectively replaces the encoding format when the banks are build.

For playing loose audio files not built into banks, the “best” format is subjective. Each format has different advantages and disadvantages, and thus which format is best depends entirely on the unique requirements of your game.

Hey! We’re not building into banks as we’re not building a game, but it’s certainly an approach I’d consider. We have to think about streaming as well, which is why we can’t use lossless formats. I was more referring to which non-bank format is best supported by fmod, especially for multichannels formats.

  • mp4 isn’t supported in fmod for > 2 channels
  • flac doesn’t support > 8 channels
  • ogg supports everything, but is ageing a bit
  • opus support is apparently ‘experimental’ - are there any updates on this?

Currently we’re using mp4 for stereo files and ogg for multichannel, but I’d like a long-term solution. MPEG-H is also an interesting format, as we’re looking to support multichannel sound objects and 360º (ambisonic) sounds, but it seems that although it’s ‘open source’ it’s actually currently exclusively used by Dolby. Do you have any experience there?

To clarify Joseph’s remarks on AAC, we don’t support the format due to licensing constraints imposed on us by having our own decoder. That said, for iOS in particular (and Android) we are able to decode AAC using platform provided decoders, for iOS that decoder is the AudioQueue API. AudioQueue is what is imposing the constraint, I tested your file in the debugger and I can see an “unsupported format error” being returned, however I get no such error with 6 channel or stereo.

If you have control over the encoding side of things, I highly recommend using our FSB format, we have command line tools and an API that you can use to integrate it with your pipeline (no FMOD Studio required). You can create individual files (one FSB per source sound) or pack multiple files into one. The formats it supports are our recommendations and their decoding is the most optimized.

If that’s not an option for you and memory / performance aren’t a major concern I’d recommend using Ogg Vorbis, it’s a solid format and quite flexible. At this stage we have no plans for a fully cross-platform Opus decoder, we will be supporting it within our FSB container format for consoles with hardware decoders only.

@mathew thank you! :clap: That is extremely helpful and has clarified all the questions I had. I’ll consider all those options very carefully and make a better-informed decision now.