FMOD Adapter Plugin
Introduction
Welcome to this guide on integrating the ODIN Voice Chat Plugin with the FMOD Audio Solution in Unreal using FMOD Adapter Plugin for ODIN Voice. The code of this plugin is available in the ODIN-FMOD Adapter Unreal Plugin repository.
What You'll Learn:
- How to use the
UOdinFmodAdapterComponent
in your project - Properly set up ODIN in Unreal when using FMOD as audio solution
- Deal with limitations and potential pitfalls
Getting Started
To follow this guide, you'll need to have some prerequisites:
- Basic knowledge of Unreal as well as FMOD
- The FMOD Plugin for Unreal, which you can get here
- The ODIN Voice Chat Plugin, available here
To set up FMOD in your project, please follow FMOD's in-depth integration-tutorial. You can find the tutorial here.
To set up the ODIN Voice Chat Plugin, please take a look at our Getting-Started guide, which you can find here:
Begin ODIN Getting Started GuideThis guide will show you the changes to make, when integrating Odin with FMOD based on the outcome of the Getting Started Guide - as most steps are identical to the usual integration of Odin in your Unreal Project and we only need to exchange a few nodes and scene components in the end.
A sophisticated example can be found in a branch of our Demo Project Repository. A minimal sample is available in our Minimal Sample Repository.
Plugin Structure
The plugin's structure is fairly straight forward - it consists of two classes basically:
- The
UOdinFmodAdapterComponent
working as a substitute for the UOdinSynthComponent. This component passes the Odin Media Stream to the FMOD Audio Engine instead of the Unreal Audio Engine. - The
UFmodOdinSubsystem
starts Odin with the correct sample rate, defined in FMOD. This class does its work without the need to adjust anything in the Unreal Project.
Usage
Installation
You can install the plugin similarly to the Odin plugin:
- Go to the Github repository and download the Code.
- Unpack and copy to your Unreal Project's
Plugins
folder. If not present, create the folder manually. - Follow the steps in below to implement the Adapter Component in your game!
FMOD Studio
The UOdinFmodAdapterComponent
takes an FMOD Event to playback the Odin Media Stream in your Unreal Project. This is mainly used to define additional properties and effects in FMOD Studio that should be applied to the voice chat audio. For instance, this enables the FMOD audio engineer to apply 3D Attenuation to the voice chat.
These are the steps to take in FMOD Studio:
- Define an FMOD Audio Event
- Set the Event to Persistent playback
- Apply all needed effects specific to your project
- Add the event to a sound bank
That is all that is needed to setup the event in FMOD Studio, the other steps are taken in the Unreal Project. Build the FMOD Project as usual - exporting to your Unreal Project and switch to the Unreal Editor.
Integration the Adapter in your Unreal Project
In the next step we will now use the Adapter Component to play back the incoming Odin Media Stream.
First replace the creation of an OdinSynthComponent
that you have placed in
the Odin Unreal Guide
in your project with the plugin's UOdinFmodAdapterComponent
.
In the OnMediaAdded
event of your Odin implementation in your project you can then call the Play Odin Voice
afterwards. This function takes the FMOD Event defined earlier and the Odin Media Stream as Inputs. If both are valid, it will assign the Media Stream and then play the FMOD Event. This should look something like this:
Like with the OdinSynthComponent
, you can also choose to place the UOdinFmodAdapter
directly on the Player Character
as a component and then reference it in your OnMediaAdded
event handler. This way you do not have to create it in the
Blueprint and it is easier to change its properties - e.g. its FMOD-specific (attenuation) settings.
Conclusion
This simple implementation of an Odin to FMOD adapter for Unreal is a good starting point to give you the control over the audio playback that you need for your Odin Integration in your project. It is flexible enough to enable your Audio Engineers and Unreal Programmers to make changes to the behavior and acoustics of your Voice Chat.
This is only a starting point of your Odin Integration with FMOD and the Unreal Engine. Feel free to check out any other learning resources and adapt the material like needed, e.g. create realistic or out of this world dynamic immersive experiences with FMOD Spatial Audio aka "proximity chat" or "positional audio":