The section will be a brief tutorial on setting up a simple Unreal Project to exercise the features of the Meta XR Audio Plugin for FMOD. Please ensure you have set up everything according the setup portion of the documentation.
Prerequisites
Set up a new FMOD project
The first step in this demo is to create a new FMOD project which will use the Meta XR Audio Plugin for FMOD to spatialize some sources. To do so, open your FMOD Studio application. Depending on your FMOD preferences settings, a different window may open, but you ultimately want to select File > New to create a new project.
Add our audio source
In our demo, we will have one source, so navigate to the Event panel, right-click and then select New Event. Make sure that you select 3D Timeline as the event type, as 2D will not allow for spatialization. Rename the event to something we can remember and reuse, in this case we will select voiceEvent. Next in the Event viewer we must add a .wav file that the Event can play back. Choose a .wav file from your file explore and drag and drop it into the event’s timeline.
It is also a good idea to right click the event and Assign to Bank > Browse > Master so it is sure to be rendered.
Replace default spatializer
By default FMOD will populate the 3D Event with an FMOD Spatializer. Since we will be using the Meta spatializer instead, right click the FMOD spatializer and delete it from the signal chain. Then right click and select Add Effect > Plugin Effects > Meta > MetaXRAudio Source to add a spatializer for this source. At this stage the project should look like below:
Generate banks
Remember that each time we make changes to our FMOD projects and are ready to test, we should generate the audio banks or else the changes may not apply. To do so, click File > Build All Platforms.
We are now set up to get basic spatialization from this FMOD project. To test in FMOD, simply play your Event and move the 3D preview panner around to hear that the Event is being spatialized. Now that FMOD is set up, the next step is to set up Unity and test it out in a game.
Create a new Unreal project
Open Unreal Engine and on the New Project page click Games > First Person as the type to provide us with a template project to work with.
Connect the FMOD and Unreal projects
To activate FMOD within the projects, we will follow the exact steps laid out by the FMOD to Unreal installation guide. The general steps of this process are summarized as:
Copy the plugin to your Unreal Project’s “Plugin” folder following any additional per platfrom instructions
In your Unreal project make sure the FMOD plugin is activated under Edit > Plugins and restart if necessary after activating it
In Unreal press Help > Validate FMOD to run the setup wizard and follow its steps
In your FMOD Studio project build all the banks
Follow this guide to ensure your Unreal Project can access the MetaXRAudioFMOD.dll and libMetaXRAudioFMOD.so in both editor and during the compiled game
Set up a new FMOD project
The first step in this demo is to create a new FMOD project which will use the Meta XR Audio Plugin for FMOD to spatialize some sources. To do so, open your FMOD Studio application. Depending on your FMOD preferences settings, a different window may open, but you ultimately want to select File > New to create a new project.
Add our audio source
In our demo, we will have one source, so navigate to the Event panel, right-click and then select New Event. Make sure that you select 3D Timeline as the event type, as 2D will not allow for spatialization. Rename the event to something we can remember and reuse, in this case we will select voiceEvent. Next in the Event viewer we must add a .wav file that the Event can play back. Choose a .wav file from your file explore and drag and drop it into the event’s timeline.
It is also a good idea to right click the event and Assign to Bank > Browse > Master so it is sure to be rendered.
Replace default spatializer
By default FMOD will populate the 3D Event with an FMOD Spatializer. Since we will be using the Meta spatializer instead, right click the FMOD spatializer and delete it from the signal chain. Then right click and select Add Effect > Plugin Effects > Meta > MetaXRAudio Source to add a spatializer for this source. At this stage the project should look like below:
Generate banks
Remember that each time we make changes to our FMOD projects and are ready to test, we should generate the audio banks or else the changes may not apply. To do so, click File > Build All Platforms.
We are now set up to get basic spatialization from this FMOD project. To test in FMOD, simply play your Event and move the 3D preview panner around to hear that the Event is being spatialized. Now that FMOD is set up, the next step is to set up Unity and test it out in a game.
Spatialize a source
Now in Unreal we want to add a game object which can be the source of our FMOD event from above. In the content browser we will find all of our available FMOD Events.
For ambient events that should loop forever, simply drag and drop the event into the game. For this game, we will grab the “Sound” event and drag it into the game. Now our Unreal project should look something like the following:
Hit play in Unreal and move around to listen to the spatialization in action.
Adding reverb
Next we can make our audio more realistic by adding reflections to the audio. To do, simply head to the FMOD project and click Window > Mixer. Click on Master Bus and find its DSP signal chain at the bottom. Here right click to Add Effect > Plugin Effects > Meta > MetaXRAudio Reflections. You only have to do this once for your entire projects no matter how many events are being spatialized as all events share this single reflections instance. The FMOD Project should look like the following:
Return to the Unreal Project and hit play to hear how it sounds with the reverb added. From here you may want to gain additional control over how the reverb sounds. Since the reverb is meant to realistically reflect the in game geometry and materials, this is done in Unreal. Head to the unreal project and find the level heirarchy. Right click to add a new component of Meta XR Audio Room Acoustic Properties. We will use this object to represent our game’s overall geometric properties. Now start the game again and change these controls in real time to hear how they impact the reverb’s sound.
Adjusting source settings
Each source spatializer instance has a few additional settings to help customize the sound for each event. To display one of these, check out the MetaXRAudio Source plugin for our myEvent and find the Source Directivity control. By default it is None but for this demo change it to Human Voice. Now play the game again and hear how the sound filters as you move around the source sphere.
To demonstrate how ambisonics work in the MetaXRAudio SDK, we will now add an ambisonic bed into our project. Head back to the FMOD project event viewer and right click to New Event and select the type 3D Timeline. Next find an ambisonic file in your file browser and drag and drop it onto the timeline. Next delete the default FMOD spatializer and add a Meta Ambisonic plugin by selecting the new event and right clicking the signal chain to Add Effect > Plugin Effects > Meta > MetaXRAudio Ambisonic. The FMOD project should now look as follows:
Return to the Unreal project and hit play. Listen to the ambisonics being rendered and take note of how it will rotate as you move about the scene.
Outcome
That concludes our tutorial building a real project using the Meta XR Audio Plugin for FMOD and Unreal. You should now be able to quickly spatialize any new events you add to your game as well as alter the room acoustics for the project.
Learn More
To take your spatialized mono events to the next level learn how to use Acoustic Ray Tracing.