Audio interface support on Android

One of our customers asked if our app would have Audio Interface support.
Didn’t know what it meant at that time, and now I think they want something like these.
Vid1
Vid2
Vid3

We don’t have any USB Audio Interface and all our sounds in the app go through FMOD API, so had to ask here.

Does FMOD API on Android support USB Audio Interface?
If so, does the API detect it automatically?
If we need to do something manually, then what is it?
Currently, our app has an option to switch between OpenSL and AAudio, and that’s it.

FMOD always outputs to the default device so if the attached device assumes the role of default (i.e. system sounds come out of it) then it will work with FMOD. We have not implemented device enumeration and selection on Android, so you cannot see a list of attached device and choose the desired one like you can on Desktop platforms.

2 Likes

So what you mean is, as long as their Audio Interface is class-compliant and their Android device can see and support it, is it safe to say any apps using the FMOD Core API always support it?

Also, I wonder what would happen when a user pulls out their Audio Interface at runtime (while the FMOD API is working).
No issue at all just like when a user plugs in/out their headphone?

PS. Sorry but I’m a bit confused now.
Our app manually selects FMOD_OUTPUTTYPE_AAUDIO
or FMOD_OUTPUTTYPE_OPENSL according to the user settings instead of the default FMOD_OUTPUTTYPE_AUTODETECT.
Will this prevent Audio Interfaces from working?

By the way, the first video wasn’t it.
You should watch the third one.
The first one, I think, is about adding another input/output to the device just like plugging a USB-C type headphone.

Update:
I just learned about USB Mixer from here which I didn’t know existed.
I don’t know what our customers exactly wanted, but my question is, do the FMOD support both on Android?

Firstly, to clarify there are two categories of thing we are discussing, output plugins (Audio Track, OpenSL, AAudio) and output devices (on Windows this would be speakers, headset, built-in, hdmi, etc). For Android we support three different output plugins, representing the evolution of Android audio APIs, each has different requirements, the auto detect mode tries to select the best for your device. For all three of our output plugins on Android, FMOD will always output to the default virtual device. For Android, this is something the system usually manages, so usually output to speaker, headphone (when you plug them in), bluetooth speaker (when you pair it). These route changes to different devices is an Android system feature, we still output to “default”, the system routes as needed. So provided the system recognizes the attached audio device and re-routes audio accordingly, FMOD will output to that device.

Specifically, we haven’t tested the devices you have listed, so we cannot confirm what their behavior will be. Also, considering this is Android, different manufacturers of phone may have different behavior.

Regarding your question about what happens when unplugged, FMOD will detect a device failure (due to disconnect) and it will reset the audio automatically. So if the system re-routes audio from the now unplugged device to the system speakers, FMOD audio should follow to the speakers.

1 Like

This is really informative and helpful. Thank you very much!