Working with Audio in Unreal

Important

All Oculus Quest developers MUST PASS the concept review prior to gaining publishing access to the Quest Store and additional resources. Submit a concept document for review as early in your Quest application development cycle as possible. For additional information and context, please see Submitting Your App to the Oculus Quest Store.


We're no longer accepting submission of 32-bit Oculus Quest apps. Any new or updated Oculus Quest application needs to be 64-bit. Please contact Oculus if you are unable to comply with this policy. Oculus Go and Gear VR apps will not be affected by this change.

Audio is critical for creating a persuasive VR experience and can contribute strongly to the user’s sense of immersion. You can use the Oculus audio spatialization tools in Unreal to create the best audio experiences for your VR apps.

Audio Spatialization and Propagation Support

The Oculus Audio SDK includes spatialization plugins (OSPs) that provide Head-related Transfer Function (HRTF) spatialization, reverb modeling, and audio propagation for UE4 and audio editing tools commonly used with Unreal, including Audiokinetic Wwise and FMOD Studio.

The audio propagation feature of the spatializer provides real-time reverb and occlusion simulation based on game geometry. Its goal is to provide accurate audio propagation through a scene with minimal set up.

  • FMOD supports Oculus Go, Oculus Rift, and Gear VR development
  • Wwise supports Oculus Rift development

You can also use FMOD or Wwise directly with the their Oculus audio plugins, which provides access to Oculus spatialization features (but not propagation) as well as the functionality of the audio tools themselves.

UE4 also offers built-in HRTF-spatialization only spatialization for Rift with and limited support for Oculus Go and Gear VR. For an example implementation, see AmbientSound Spatialize in the Unreal Audio Content Example.

When Unreal PC (Rift) applications are launched, if the OculusVR plugin is enabled and the Oculus VR Runtime Service is installed, then the application will automatically override the default Windows graphics and audio devices and target the Rift. The Oculus VR Runtime Service is installed with the Oculus app.

Use the Oculus Audio Plugin in Unreal

You can use the Oculus audio plugin in Unreal Engine by following the steps in the next few sections.

Prerequisite: UE4 Audio Mixer Integration

Before you enable the Oculus audio plugin, make sure you have explicitly enabled the Audio Mixer for Unreal. For more information, see the Unreal Engine quickstart guide.

Setup a Project to Use Oculus Audio

First enable the Oculus plugin for your project:

  1. Open your project in Unreal Engine.
  2. Go to Edit > Plugins, find Audio and check to select Oculus Audio Plugin.
  3. Restart Unreal when prompted.
  4. Select the plugin: Go to project settings and choose Edit > Project Settings, under Platforms > Windows, scroll to the Audio section at the bottom of the page. Then select Oculus Audio for both the Spatialization Plugin and Reverb Plugin. You can leave the other settings as-is.

    The following image shows an example.

  5. Make sure Late Reverberation is enabled for the Oculus Audio Plugin. Go to Edit > Project Settings > Plugins > Oculus Audio, and select Late Reverberation if needed.

The project is now configured to use the Oculus Spatializer.

Add a Sound to the Scene

Select the scene you want to modify and:

  • Use the Import option to import a sound file into the Content Browser
  • Drag that sound asset into the scene.
  • Add a new Sound Attenuation object to the scene. Go to Add New > Sounds >Sound Attenuation.
  • Select the sound attenuation object and choose Edit. On the Details tab:
    • Set the Spatialization Method to Binaural
    • Under Attenuation Plugin Settings, add a new Oculus Audio Source Settings

The following image shows an example:

Example of how to add a sound

  • Use the Oculus Audio Source Settings to configure your sound source. You can reuse the attenuation settings object for other sounds.

unreal audio source settings

Audio Propagation (Beta)

The audio propagation feature provides real-time reverb and occlusion simulation based on game geometry, and consists of two new components:

  • Oculus Audio Geometry
  • Oculus Audio Material

To use the feature, you simply tag the scene meshes that you want included in the simulation and select the acoustic material for each mesh.

Set up Audio Propagation

Before you use the audio propagation feature, make sure you have the latest version of Unreal Engine that includes the latest Oculus Audio Spatialization plugin (v1.34).

  • Follow the previous steps to set up the Oculus Plugin and add sounds to your project. Make sure that Late Reverberation is enabled for the plugin.
  • Add a static mesh actor to the acoustic simulation.
  • Select the actor in the scene and select Add Component then Oculus Audio Geometry Component.
  • To set the acoustic properties, select Add Component and then add an Oculus Audio Material to the mesh. The following image shows an example:

Note: If you want all attached child actors to also be included in the simulation then check the “include children”.

You customize the acoustic properties of the children by adding an Oculus Audio Material to a child, and the material will propagate to any children of that child as well. Note that children which are included cannot be moved/rotated/scaled separately to the parent, if it needs to be independent then attach a Oculus Audio Geometry Component to the child.

Landscape and BSP

You can also use OculusAudioLandscape and OculusAudioBSP components, which include the landscape and/or BSP in the acoustic simulation. You cannot attach components to Landscapes or BSP objects, instead attach these to any actor in the scene.

Note: The virtual room width/height/depth and reflection coefficients are not used when propagation or dynamic room modeling is enabled.

Oculus Audio Wwise Integration to Use Propagation

You can use the Oculus Audio spatializer including audio propagation when you develop for Oculus Rift with Wwise and UE4.

Install Wwise

Download the Oculus Spatializer for Wwise

Install the plugin for Wwise by copying the OculusSpatializerWwise.dll and OculusSpatializerWwise.xml files under your Wwise installation directory. See Installing the Wwise Authoring Tool for more information.

Set Up a New Project

Make sure you have the Wwise Launcher installed. Then, integrate Wwise in the Wwise Launcher by clicking the Unreal tab and then selecting Integrate Wwise into Project. For more information, see the Audio Kinetic website.

Copy the OculusSpatializerWwise.dll under the project directory Binaries folder:

[Project Directory]/Binaries/Win64

  • Follow the instructions in [ How to Use Oculus Spatializier in Wwise](/documentation/audiosdk/latest/concepts/osp-wwise-usage/.

  • Make sure that Early Reflections and Reverberation are enabled.
  • Make sure Global Scale is set to 0.01 because UE4 units are centimeters.

Note: the Room Dimensions and Wall Reflection Coefficients are not used when propagation or dynamic room modeling is enabled.

The following image shows an example.

To Set Up Propagation

  • Add OculusAudioGeometry components to static mesh actors that should be used in the propagation simulation.

Include the Oculus DLL in the Build

You must copy the the Oculus Spatializer DLL to the packaged build. Copy the Oculus Spatializer DLL (OculusSpatializerWwise.dll) to:

[Packaged Build Directory]/[Project Name]/Binaries/Win64/WindowsNoEditor/[Project Name]/Binaries/Win64

Oculus Audio FMOD Integration to Use Propagation

You can use Oculus audio propagation when you develop for Oculus Rift with FMOD and UE4.

Set Up a New Project

Follow the instructions on the FMOD website for setting up the FMOD UE4 integration.

Next, once you have the FMOD UE4 plugin installed and enabled you need to add the Oculus Spatializer to the FMOD Studio project.

  • Add the Oculus Spatializer to the plugins for the FMOD UE4 integration.
    Inside UE4 editor go to Edit > Project Settings > Plugins > FMOD Studio The following image shows an example.

  • Copy the Oculus Spatializer DLL (OculusSpatializerFMOD.dll) to the project directory: [Project Directory]/Plugins/FMODStudio/Binaries/Win64

Include the Oculus DLL in the Build

You must copy the Oculus Spatializer DLL to the packaged build. Copy Oculus SpatializerFMOD.dll to:

[Packaged Build Directory]/[Project Name]/Plugins/FMODStudio/Binaries/Win64

Adusting Propagation Results

Audio propagation generates reverb from game geometry, so to make adjustments, you need to adjust the geometry or materials. The propagation system doesn’t expose parameters like decay time, or low frequency roll-off.

In addition, the audio propagation system models occlusion with a simple line-of-sight calculation, and does not model diffraction. That means that the transition from audible to obstructed can be abrupt and may require some adjustments. Use the following guidelines to adjust the results:

  • If a room or space is too live, meaning the materials in the room are reflecting too much sound, consider marking one or more of the walls as a less reflective material like carpet.
  • If the sound in a room is too deadened, then consider changing some of the materials to be more reflective.
  • Use the per-source send level and an overall wet level parameter to get the reverb level right.

More info

For more information on our plugins, and for general information about audio design for VR, please see our Audio SDK Developer Guide.