The FMOD Studio Unity Integration is a Unity plugin which allows the use of FMOD in Unity games.
The Oculus Spatializer Plugin (OSP) for FMOD is compatible with FMOD Studio Unity Integration for projects targeting Windows (32/64 bit), OS X, and Android. Two versions of the FMOD Studio Unity Integration are currently available: 2.0 and Legacy. The OSP for FMOD is compatible with:
If you are migrating from the Legacy Integration, please follow FMOD’s migration guide here: https://www.fmod.com/resources/documentation-api?page=content/generated/engine_new_unity/migration.html#/
Otherwise, take the following steps:
AudioSDK\Plugins\FMOD\Unity
to import into your project.You should now be able to load and play FMOD Events that use the OSP in your Unity application runtime.
AudioSDK\Plugins\FMOD\Unity
to import it into your project.FMOD_Listener
script, which should be attached to an object in the root of the scene. In the Unity Inspector view, increment the Size of Plugin Paths by one, and add ovrfmod in the new element.OS X platform only: In FMOD_Listener.cs
, in LoadPlugins()
, modify the body of the foreach loop with the following code inside the OCULUS start/end tags:
foreach (var name in pluginPaths)
{
// OCULUS start
var path = pluginPath + "/";
if(name.Equals("ovrfmod") && (Application.platform == RuntimePlatform.OSXEditor ||
Application.platform == RuntimePlatform.OSXPlayer ||
Application.platform == RuntimePlatform.OSXDashboardPlayer) )
{
path += (name + ".bundle");
FMOD.Studio.UnityUtil.Log("Loading plugin: " + path);
}
else
{
path += GetPluginFileName(name);
FMOD.Studio.UnityUtil.Log("Loading plugin: " + path);
#if UNITY_5 && (UNITY_64 || UNITY_EDITOR_64)
if (!System.IO.File.Exists(path))
{
path = pluginPath + "/" + GetPluginFileName(name + "64");
}
#endif
#if !UNITY_METRO
if (!System.IO.File.Exists(path))
{
FMOD.Studio.UnityUtil.LogWarning("plugin not found: " + path);
}
#endif
}
// OCULUS end
uint handle;
FMOD.RESULT res = sys.loadPlugin(path, out handle);
ERRCHECK(res);
}
Now you should be able to load and play FMOD Events that use the OSP in your Unity application runtime.