Possible to route FMOD through bus in UE5?

Hi all

We are working on a project that needs to make use of both FMOD for music and UE5’s audio (metasounds and basic audio capabilities etc) for sound design.

We really need to be able to route FMOD’s output through a bus in UE so that we can manipulate and modulate it in relation to sonud design…and vice versa.

Is this possible? Can’t find any info on how to do it.

Also - someone suggested to me that FMOD doesnt get on well with UE5 native audio when it comes to console porting etc. Has anyone else experience of this goor or bad?

Thanks a lot!
Ben

Hi,

Firstly, as an aside, FMOD support for Audiolink is currently in development. However, AudioLink doesn’t allow FMOD audio to be routed into UE, only for UE audio to be routed into FMOD, which by the sounds of things probably doesn’t address your use-case.

While I’m unsure where exactly UE’s audio system exposes a buffer for you to submit sample data to, it is 100% possible to retrieve audio data from your FMOD system. This can be done in two ways: either by creating a custom output plugin for the FMOD system to output to, or by inserting a custom DSP into the system’s DSP graph. A custom output is cleaner to implement and is easier to synchronize with an external buffer, but only allows you to access the system’s final mix, whereas a custom DSP potentially allows you retrieve audio from different points within the system (i.e. multiple Buses).

To retrieve audio with a custom output plugin, you can define an FMOD_OUTPUT_MIXER_CALLBACK, use FMOD_OUTPUT_READFROMMIXER_FUNC within it to generate and retrieve audio from the mixer. If you need to synchronize your buffers, you can block within FMOD_OUTPUT_MIXER_CALLBACK until you need to execute a new mix. You will also need to modify FMODStudioModule.cpp to set the Core System’s output to your custom output plugin. I would recommend taking a look at the “output_mp3” Core API example for a basic example of how you might set up a custom Output plugin, as well as the Output Plugin API Docs.

For a custom DSP, the “dsp_custom” Core API example shows how to create a custom DSP that uses FMOD_DSP_READ_CALLBACK to access audio data that is input into a custom DSP, and how attach the DSP to a given channel in the FMOD system. You can find more info on the DSP Plugin API in our DSP Plugin API Reference.

As for using FMOD alongside UE native audio, you shouldn’t run into any issues besides a couple of platforms, where UE audio will need to be disabled. On iOS/tvOS, both systems require exclusive control of the AudioSession, and on XBOX One and Series X/S or PS5, where both systems attempt to consume all spatialization resources. Please read over the Disabling Unreal Audio Device section and Platform Specifics chapter of our Unreal Integration Docs for more info.

1 Like

Hi Louis

Thanks for taking the time to reply in depth.

While I digest the first part of your message, I have a follow up question for the second (FMOD running along aside UE audio).

If FMOD is only being used for music - in 2D timeline events - and so not using up spatialsiation resources, would it still work along side UE’s audio system? We are not at the porting stage yet so I can’t test this myself, but we need to make a decision about what to do soon as I build the complex music systems!

Thank you

Unfortunately no - FMOD will automatically attempt to claim spatialization resources on those platforms regardless of whether or not you’re using 3D spatialization. A new feature that provides a means of adjusting how much FMOD attempts to claim is currently scheduled for development, but I cannot provide a timeline for when development will begin or finish.

That said, there may be a workaround for this, so I’ll do some digging and get back to you.

Hi Louis

Thanks for getting back to me. Sounds like that new feature could be a lifesaver for us, but I appreciate you can’t give a timeline on it…which might be a problem.

if you can find a workaround, that would be amazing! Please do keep in touch :slight_smile:

1 Like

Each of the platform packages for the FMOD Unreal integration contain FMODPlatform.cpp. By default, the function FMODPlatform_SetRealChannelCount() in FMODPlatform.cpp uses the “Real Channel Count” in your UE project’s FMOD settings as the amount of AT9/XMA codecs to use for PS5/GameCore respectively. However, if you modify the code to set the codec count to 0:

// PS4/5 FMODPlatform.cpp
// advSettings->maxAT9Codecs = Settings.RealChannelCount;
 advSettings->maxAT9Codecs = 0;
// XBone/GameCore FMODPlatform.cpp
// advSettings->maxXMACodecs = Settings.RealChannelCount;
 advSettings->maxXMACodecs = 0;

Then you should be able to run FMOD without claiming any of the resources that you want UE Audio to use. Give it a shot and let me know whether you still run into any issues.

Hi, is there any already beta access to the Fmod AudioLnk module for UE5 ?

Or maybe there is some other way to redirect the audio stream from the UE bus to the FMOD bus.

Unfortunately, I can’t offer beta access for AudioLink support. That said, while I can’t provide any timeline for release, the bulk of development on it has been finished and it’s currently in QA.

While there’s no ready-made feature to point to in the FMOD for Unreal plugin, if you can retrieve sample data from UE without using AudioLink, then it is entirely possible - you would essentially be doing the inverse of what I mentioned in my first reply in this thread.

Using a DSP would function similarly, but instead of extracting sample data from the read callback, you would provide your own. Alternatively, instead of using an output plugin, you could create a Sound (or use a programmer instrument, if using the Studio API) and provide the audio data that way - see the Core API example “user_created_sound”, and the Core API guide section on Creating a Sound by manually providing sample data for more information.

1 Like

Any news on AudioLink? Would be a big thing for me!
I would like to route UE MediaPlayer Output into FMOD.

Audiolink support was added in FMOD 2.02.20.

1 Like

Is there something about it in the documentation? I need some introduction to the workflow and how to work with Audiolink.

Try here : https://fmod.com/docs/2.02/unreal/audiolink.html

Ah, thank you! Somehow the search function has not shown any result when searching for “audiolink”…

Yep, I noticed that too just now. We’ll get that fixed.

1 Like