Unity Integration 2.03
In this user guide we provide a step-by-step walkthrough for getting started with FMOD for Unity, as well as a high-level description of various ways you can use FMOD for Unity and FMOD Studio to add adaptive audio to your Unity game.
To get started using FMOD for Unity, you need to install the plugin and access your FMOD Studio content.
Follow these steps to install FMOD for Unity:
If you need to install a version of FMOD for Unity that is different to the version on the Unity Asset Store (e.g. for compatibility with the version of FMOD you're using), you can download a package from https://fmod.com/download and import it by selecting "Assets > Import Package > Custom Package..." from the Unity menu bar.
All of the plugin's files are located by default in:
The FMOD Plugin base folder can be moved anywhere inside the Assets directory or outside of that for use with the Unity Package Manager (UPM). The integration will use the GUID within the FMOD.meta to find where you've moved everything, so it's critical the file is moved and not regenerated.
To use FMOD with the UPM you will need to:
FMOD folder and FMOD.meta file to the new folder.FMOD folder.
{
"name": "com.firelight.fmod-for-unity",
"version": "2.3.14",
"displayName": "FMOD for Unity"
}
version should reflect your Integration Version.In order to access your FMOD Studio content, you need to locate the .bank files that FMOD Studio produces, and configure a few other settings. To do so, follow these steps:

With this access method, you specify the location of an FMOD Studio project, and FMOD for Unity locates the .bank files within it. You can store your FMOD Studio project in your Unity project if you wish.
All developers on the game will need access to the FMOD Studio project.
In the FMOD for Unity settings, set Source Type to FMOD Studio Project:

Then click the Browse button and locate the .fspro file:

With this access method, you specify a directory containing a single set of .bank files built from the FMOD Studio project. This is suitable if you are developing a game for a single type of platform (such as mobile only), as you will only need one set of .bank files. You can store your .bank files in your Unity project if you wish.
All developers on the game will need access to the .bank files.
In the FMOD for Unity settings, set Source Type to Single Platform Build:

Then click the Browse button and locate the directory that contains your .bank files:

With this access method, you specify a directory containing subdirectories that contain sets of .bank files built from the FMOD Studio project. This is suitable if you are developing a game for multiple types of platforms (such as PC and mobile), as you will need separate .bank files for each platform. You can store your .bank files in your Unity project if you wish.
All developers on the game will need access to the .bank files.
In the FMOD for Unity settings, set Source Type to Multiple Platform Build:

Then click the Browse button and locate the top-level directory:

You will then be able to set the Project Platform (consisting of subdirectory and speaker mode) that you want each platform to use:

You can store your FMOD Studio source files (your project or .bank files) in a directory at the top level of your Unity project. This allows you to provide access to them through the same mechanism you use for your Unity project. You can also set a relative path in the FMOD for Unity settings, so that even if you move your Unity project the source files can still be found.
To do this, create a new directory at the top level of your Unity project (for example FMODAssets) and put your source files inside it:

Then click the Browse button and locate your source files. This will set a relative path in the FMOD for Unity settings:

If you are using a single platform build or a multiple platform build, you can set the "Built banks output directory" in FMOD Studio so that it places .bank files in your Unity project automatically:

For each platform, set the "Surround speaker mode" component of the Project Platform setting to match your FMOD Studio project:


Once you have set up access to your FMOD Studio content, you can add FMOD content to your Unity project in several ways.
Add the FMOD Studio Listener component to the main camera Game Object in your scene. This will provide the FMOD Engine with the information it needs to play 3D events correctly.

The FMOD Event Browser shows all available events, snapshots, banks (.bank files), and global parameters. You can access the FMOD Event Browser by selecting "FMOD > Event Browser" from the Unity menu bar, and drag content from it into the Scene window to create Game Objects:
You can add FMOD components to Game Objects using the Add Component button in the Inspector. For each component, you can choose which trigger conditions will trigger its actions. The available components are:
Reverb zones activate reverb or other effects to alter the overall quality of the soundscape based on the player's location. You can create them using snapshots and FMOD Studio Event Emitter components in combination with Unity collider components:
To trigger an event or snapshot from a Timeline, add an FMOD Event Track to the Timeline. You can then add an FMOD Event Playable to this track, and configure it to play your event or snapshot. See the Timeline chapter for more information.
Visual scripting units are provided for accessing the FMOD Studio, FMOD Core and FMOD Unity APIs. Please see the Visual Scripting section for instructions on setup and usage.
Connecting FMOD Studio to your game using live update allows you to adjust, mix, and profile your content while the game is running. Live update must be enabled in the plugin settings before FMOD Studio can connect to your game. It can be enabled or disabled independently for each platform, and for Play In Editor mode.
Follow these steps to connect using live update when playing in the Unity Editor:
In the Platform Specific section of the FMOD for Unity settings, select the Editor platform and set Live Update to Enabled. You can set the network port used for the connection in the Live Update Port field.

Click the Play button in the Unity editor.
If there is a networking error, the plugin will continue and restart without networking enabled:
FMOD Studio: Cannot network port for Live Update, restarting with Live Update disabled. Check for other applications that are running FMOD Studio
Load your project in FMOD Studio.
Enter the IP address of the computer running Unity. If you are running FMOD Studio on the same computer as Unity you can use the name "localhost" or the IP address "127.0.0.1".
If the Live Update Port field is set to 9264 (the default) in the FMOD for Unity settings, you can simply select the "localhost" option from the address dropdown list:

If the Live Update Port field is set to a different number (e.g. 9500), select the new address option from the address dropdown list. Then enter the IP address and the port separated by a colon:

Click the Connect button on the dialog. When you've connected successfully, the live update indicator in the FMOD Studio status bar will change to Live Update On.
Check that your application has networking permissions. Some platforms require a manifest that requests permissions:
Android:

Xbox One:

You can implement dialogue efficiently in FMOD using audio tables and Programmer Instruments. If your game supports multiple spoken languages (or you intend to add support for this in the future), we recommend using localized audio tables.
You can play sounds from audio tables by playing an event that contains a Programmer Instrument, and handling some event callbacks in your game code. This is demonstrated in the Programmer Sounds scripting example.
When building a bank that contains a localized audio table, FMOD Studio produces one .bank file for each locale, with the locale code appended to the .bank file name. To set the current locale, load the .bank file that has the desired locale code. If more than one localized .bank file is loaded at once, the FMOD Engine will only use the one that was loaded first.
To control which .bank files are loaded, set the Load Banks option in the FMOD for Unity settings to either None or Specified. If you set it to Specified, make sure that no more than one localized .bank file is added to the Specified Banks list.

To change the locale, unload the current localized .bank file, and then load the new localized .bank file. You can do this using the FMOD Studio Bank Loader component, or by calling RuntimeManager.LoadBank and RuntimeManager.UnloadBank from your own script.
Managed methods, that need to be marshaled to a C function pointer so that they can be called from native code, have a few restrictions on AOT platforms:
[MonoPInvokeCallback] attribute.For example:
[AOT.MonoPInvokeCallback(typeof(FMOD.Studio.EVENT_CALLBACK))]
static FMOD.RESULT DialogueEventCallback(FMOD.Studio.EVENT_CALLBACK_TYPE type, IntPtr instancePtr, IntPtr parameterPtr)
{
...
}
Depending on your platform, you may not need to follow all three recommendations but, we recommend always using all three. This way any edge use cases will be covered.
For more information see: Programmer Sounds Example, Timeline Callbacks Example and the Unity Scripting Restrictions for more information.
By default FMOD for Unity will load all .bank files when it is initialized. For more control over .bank file loading, set the Load Banks option in the FMOD for Unity settings to either None or Specified. You can then use the FMOD Studio Bank Loader component or the RuntimeManager.LoadBank and RuntimeManager.UnloadBank methods to load and unload .bank files as needed.

Each platform has its own audio requirements. If your game supports more than one platform, you can add the supported platforms to your FMOD Studio project, and FMOD Studio will generate a separate set of .bank files for each platform.
To use these per-platform .bank files, you must access your FMOD Studio content using your project or a multiple platform build. Then you can configure .bank file loading for each Unity platform in the corresponding section in the FMOD for Unity settings. Set the Project Platform setting for each platform to match the desired FMOD Studio platform:


When you play the game inside the Unity editor, FMOD loads the .bank files for the current Unity platform by default. However, if your .bank files contain audio with hardware specific encoding (such as AT9 on PS4 or XMA on XboxOne), then FMOD is unable to play that audio, as the required decoding hardware is unavailable. In this case, you need to load .bank files from a different platform, containing audio that can be played in the Unity editor. You can do this by setting the Project Platform setting for the Editor platform in the FMOD for Unity settings:

When iterating on audio content within FMOD Studio, it's quicker to just build for the current platform using the "File > Build..." command. When submitting your work to source control to be shared with the rest of the team, you should use the "File > Build All Platforms..." command, and then submit the updated .bank files for all platforms.
In FMOD Studio, you can set the current platform in the lower right corner of any window:

In Unity, you can set the current platform from the build settings. Select "File > Build Settings..." from the menu bar, then select the desired platform and click the Switch Platform button:

FMOD for Unity supports the ability to manage your built FMOD Banks using Unity's AssetBundles and Addressables systems. This is can be useful if your Unity project makes use of AssetBundles and Addressables for your non-FMOD assets, as you are able to integrate your FMOD Banks into your existing asset workflow.
AssetBundles and Addressables require your FMOD Banks to be imported as TextAssets. FMOD for Unity will do this for you when you set the Import Type option to Asset Bundle.
When using the Asset Bundle import type, FMOD for Unity will not load any bank files automatically - you will need to load them from your game code using the RuntimeManager.LoadBank method.
Make sure that at least one Master Bank is loaded at all times, and if you are using paths for Event Linkage then also ensure the matching Strings Bank is loaded.
When the import type is set to Asset Bundle, FMOD for Unity creates a TextAsset in the FMOD Asset Sub Folder for each source bank. These assets must be shared between all developers to preserve Asset Bundle assignments and Addressables configuration, so they should be added to source control.
Initially, each asset contains stub data consisting of a standard prefix followed by the bank name, which is used to load the source bank when playing in the editor. At build time, each asset is filled with the actual bank data for the build platform, so it can be included in the build. When the build finishes, each asset is reset to stub data.
The stub system does not cause built Addressable bundles containing FMOD Banks to change. This is important when providing updates for players, as the bundles containing the FMOD banks will only be modified when the actual banks are modified.
This section presumes familiarity with the Addressable Asset System. Please see the Unity documentation for more information: Addressable Assets Getting Started.
To assign a bank to an Addressable, select the bank's TextAsset inside the Unity Editor and tick the "Addressable" checkbox:

Any banks marked as an Addressable can be loaded via an AssetReference. The Unity Editor provides GUI helpers for finding AssetReferences in your project:
public AssetReference MasterBank;
public AssetReference MasterStringBank;
public List<AssetReference> Banks = new List<AssetReference>();

Unlike AssetBundles which require an explicit script for building, FMOD for Unity automatically hooks into the Scriptable Build Pipeline when building Addressables, using a PostDependencyCallback and PostWritingCallback to replace stubs with bank data, so no additional action is necessary.
AssetReferences are loaded asynchronously, and consequently you will need to wait for them to finish loading before you can play any Events from Banks loaded from an Addressable. Please see the Async Loading Example for more details.
AssetReferences are automatically released by the integration after the bank is loaded, so there is no need to call AssetReference.ReleaseAsset yourself after loading or unloading a Bank from an Addressable.
See Also: RuntimeManager.LoadBank, RuntimeManager.UnloadBank
This section presumes familiarity with AssetBundles. Please see the Unity documentation for more information: Asset Workflow- AssetBundles. AssetBundles have been superseded by the Addressable Asset System, so newer projects should consider using Addressables instead of AssetBundles.
Once your banks have been imported as TextAssets they can be assigned to AssetBundles.

Any banks marked to be included in an AssetBundle will be added when building AssetBundles.
Asset bundles will need to be built manually. Please see the Unity documentation for more details: AssetBundles Workflow. When building AssetBundles, you will need to call EventManager.CopyToStreamingAssets before the call to BuildPipeline.BuildAssetBundles, and then call EventManager.UpdateBankStubAssets afterwards. CopyToStreamingAssets needs to be called outside of the build process, when using AssetBundles, otherwise it will not copy the banks to the streaming assets directory:
BuildTarget buildTarget = BuildTarget.StandaloneWindows64;
EventManager.CopyToStreamingAssets(buildTarget);
BuildPipeline.BuildAssetBundles(Destination, BuildAssetBundleOptions.None, buildTarget);
EventManager.UpdateBankStubAssets(buildTarget);
Unlike AssetReferences, AssetBundles are loaded synchronously so there is no need to handle any async loading. AssetBundles can be loaded using AssetBundle API methods such as AssetBundle.LoadFromFile. To retrieve a TextAsset bank from an AssetBundle use the AssetBundle.LoadAsset<TextAsset> method, and the RuntimeManager.LoadBank(TextAsset textAsset) helper function to then load the bank from the TextAsset.
var myLoadedAssetBundle
= AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "myassetBundle"));
var bankAsset = myLoadedAssetBundle.LoadAsset<TextAsset>("SFX");
RuntimeManager.LoadBank(bankAsset);
FMOD for Unity has no way of knowing what other assets will be contained within your AssetBundles, and as such it is your responsibility to free AssetBundles when you are finished with them. You can use the AssetBundle.Unload method to free an AssetBundle. This has no effect on the banks residing in memory, and you still need to call RuntimeManager.Unload on the banks to release them.
myLoadedAssetBundle.Unload();
RuntimeManager.LoadBank(bankAsset);
See Also: RuntimeManager.LoadBank, RuntimeManager.UnloadBank
Visual scripting provides a way to create game logic without the need for code. This section presumes familiarity with Unity visual scripting. Please see the Unity documentation for more information: Unity Visual Scripting.
Manual steps are required to make FMOD Studio visual scripting units available in visual scripting graphs.
If you are using Unity's Visual Scripting package in your project, follow these steps to easily generate FMOD for Unity units for use in your script graphs.
Empty Game Object to the scene, add a Script Machine and create a new Graph.If you are using Bolt for visual scripting in your project, follow these steps to easily generate FMOD for Unity unit options for use in your flow graphs.
UNITY_BOLT_EXIST to your project's Scripting Define Symbols.Once the visual scripting add-on has been installed into the Unity project and the FMOD Studio visual scripting units have been included, your project is now ready to use FMOD Studio in visual scripting.
You can find all the FMOD Studio and FMOD Unity scripting units in the Codebase submenu.


You can find all functions available for FMOD Studio, FMOD Core, and the FMOD Unity namespaces in the various submenus. For example, to find the PlayOneShot function, the path would be FMODUnity > RuntimeManager > PlayOneShot().
Here are a few example visual scripting graphs.

This visual script loads three banks in order - first the Master bank, then the Master strings.bank, then finally the Music bank with all of its samples preloaded.

This visual script creates a 2D instance of the provided path to an FMOD Studio event and sets it as the variable Instance. The script then plays that event instance.

This visual script creates a 3D instance of the provided path to an FMOD Studio event and sets it as the variable Instance. It retrieves the 3D Attributes from the Game Object which is then assigned to the instance before it is played by the script.

This visual script takes the Instance variable created previously and adds or deducts from the parameter Progression depending if the player presses Up or Down on their controller.
All developers working on your game must have access to the source path specified in the FMOD for Unity settings (in the Studio Project Path or Build Path field). Access can be provided through source control or through a shared network drive. We recommend that you store your FMOD Studio source files in your Unity project, as this means access can be provided through the same mechanism you use for your Unity project. If you are storing your entire FMOD Studio project in your Unity project's source control repository, please see the Using Source Control chapter in the FMOD Studio User Manual for more information on correctly setting up your repository.
The plugin generates these asset files:
Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset stores all of the plugin settings. This file must be shared between all developers, so it should be added to source control.Assets/Plugins/FMOD/Cache/Editor/FMODStudioCache.asset is a cache file used to speed up the plugin UI. It does not need to be shared between developers.Assets/Plugins/FMOD/Cache/RegisterStaticPlugins.cs is generated from the target platform's Static Plugins list when building a player using the IL2CPP scripting backend. It does not need to be shared between developers.Assets/StreamingAssets/ folder at build time, so that Unity standalone builds contain the correct files. These copied .bank files do not need to be shared between developers.All log files produced by the plugin should be ignored by source control.
Here is an example of what you should add to your source control ignore file, assuming FMOD for Unity is installed in the default location:
# Never ignore DLLs in the FMOD subfolder.
!/[Aa]ssets/Plugins/FMOD/**/lib/*
# Don't ignore images and gizmos used by FMOD in the Unity Editor.
!/[Aa]ssets/Gizmos/FMOD/*
!/[Aa]ssets/Editor Default Resources/FMOD/*
# Ignore the Cache folder since it is updated locally.
/[Aa]ssets/Plugins/FMOD/Cache/*
# Ignore bank files in the StreamingAssets folder.
/[Aa]ssets/StreamingAssets/**/*.bank
/[Aa]ssets/StreamingAssets/**/*.bank.meta
# If the source bank files are kept outside of the StreamingAssets folder then these can be ignored.
# Log files can be ignored.
fmod_editor.log
Unity has a GitHub page where a master .gitignore list is maintained.
Locate the .collabignore file in the root of your Project file and add the list of files to ignore. If you can't see this file, check the instructions in the Unity Collaborate documentation.
Collaborate will only work with files inside the Assets directory. To share access to your FMOD Studio project it is recommended to do this outside of Unity Collaborate and only submit built banks.
Create or edit a file called .gitignore in your Unity project folder and add the list of files to ignore.
When building for Mac on Windows, it is important to ensure the Info.plist files have only LF endings. If they get CRLF due to Git's core.autocrlf feature the file will mismatch with the checksum used by gatekeeper and fail to load.
Create or edit a file called .p4ignore in your Unity project folder and add the list of files to ignore.
Create a file called ignore.txt in your Unity project folder and add the list of files to ignore, then run these commands:
svn propset svn:ignore -F ignore.txt .
svn ci --message "Ignoring FMOD for Unity temporary files"
You can then remove the ignore.txt file.
Configure your source control system to use line feed characters as line endings in *.bundle and Info.plist files. Here is a sample .gitattributes file, assuming FMOD for Unity is installed in the default location:
Assets/Plugins/FMOD/**/*.bundle text eol=lf
Assets/Plugins/FMOD/**/Info.plist text eol=lf
If your game uses addressables or asset bundles and is built using remote CI technology such as GitHub Actions, your banks will need to be included in source control for the FMOD Unity integration to populate Bank Stub Assets with real asset data. Built banks should be outside of the Assets directory to avoid including banks in the application binary, and the build path for these banks should be specified in your Bank Import settings.
When updating FMOD for Unity, make sure that you are using the same major version as the FMOD Studio project - otherwise the plugin will be unable to load the banks. You can check the plugin version from within the Unity editor.
To update FMOD for Unity, follow these steps:
Updating to a new minor version of the plugin (e.g. from 2.00.00 to 2.00.01) should not introduce any behavior or breaking changes - it should only add new features and fix bugs. No changes should be required unless they are part of a bug fix, in which case they will be described in the revision history.
Upgrading to a new major version of the plugin (e.g. from 2.00 to 2.01) is usually only recommended for projects at or near the beginning of development, because behavioral and breaking changes can be introduced.
If you do need to upgrade to a new major version after a project has started, you will need to read over:
These will describe specific changes that might need to be made to your project.
The Setup Wizard will appear after importing the new package to assist you with updating the FMOD native libraries. Once this process is complete, check the Updating page for tools to help you:
When upgrading from 1.10, you will see some compilation errors in the console. To resolve these, move everything from Assets/Plugins/Editor/FMOD to Assets/Plugins/FMOD/src/Editor.
Once this is done, the Setup Wizard will appear as described above.
Upgrading from versions before 1.10 is not supported. We recommend that you upgrade to 1.10 first, and then upgrade to the latest version.