Project Acoustics Unity Design Tutorial

This article describes the design tools and workflow for Project Acoustics in Unity.

Prerequisites:

  • Unity for Windows
  • A Unity scene with a baked acoustics asset

For this tutorial, you can get a Unity scene with a baked acoustics asset in two ways:

Review design process concepts

Project Acoustics uses common audio digital signal processing (DSP) methods to process your sources, and gives you control over familiar acoustics properties including occlusion, wet/dry mix, and reverberation tail length (RT60). But the core Project Acoustics design process concept is that rather than setting these properties directly, you control how simulation results are used to drive these properties. The default settings for each control represent physically accurate acoustics.

Design acoustics for each source

Project Acoustics provides a number of source-specific acoustics design controls. This lets you control the mix in a scene by emphasizing some sources and de-emphasizing others.

Adjust distance-based attenuation

The audio DSP provided by the Project Acoustics Unity spatializer plugin respects the per-source distance-based attenuation built into the Unity Editor. Controls for distance-based attenuation are in the Audio Source component found in the Inspector panel of sound sources, under 3D Sound Settings:

Screenshot of Unity distance attenuation options panel

Acoustics performs computation in a "simulation region" box centered around the player location. If a sound source is distant from the player, located outside this simulation region, only geometry within the box will affect the sound propagation (such as causing occlusion) which works reasonably well when occluders are in the vicinity of the player. However, in cases when the player is in open space but the occluders are near the distant sound source, the sound can become unrealistically disoccluded. Our suggested workaround is to ensure in such cases that the sound attenuation falls off to 0 at about 45 m, the default horizontal distance of the player to the edge of the box.

Screenshot of Unity SpeakerMode option panel

Adjust occlusion

Attaching the AcousticsAdjust script to a source enables tuning parameters for that source. To attach the script, click Add Component on the bottom of the Inspector panel and navigate to Scripts > Acoustics Adjust. The script has six controls:

Screenshot of Unity AcousticsAdjust script

  • Enable Acoustics - Controls whether acoustics is applied to this source. When unchecked, the source will be spatialized with HRTFs or panning but there will be no acoustics. This means no obstruction, occlusion, or dynamic reverberation parameters such as level and decay time. Reverberation is still applied with a fixed level and decay time.
  • Occlusion - Apply a multiplier to the occlusion dB level computed by the acoustics system. If this multiplier is greater than 1, occlusion will be exaggerated, while values less than 1 make the occlusion effect more subtle, and a value of 0 disables occlusion.

Adjust reverberation

  • Wetness (dB) - Adjusts the reverb power, in dB, according to distance from source. Positive values make a sound more reverberant, while negative values make a sound more dry. Click on the curve control (green line) to bring up the curve editor. Modify the curve by left-clicking to add points and dragging those points to form the function you want. The x-axis is distance from source and the y-axis is reverb adjustment in dB. For more information on editing curves, see this Unity Manual. To reset the curve back to default, right click on Wetness and select Reset.
  • Decay Time Scale - Adjusts a multiplier for the decay time. For example, if the bake result specifies a decay time of 750 milliseconds, but this value is set to 1.5, the decay time applied to the source is 1,125 milliseconds.
  • Outdoorness - An additive adjustment on the acoustics system's estimate of how "outdoors" the reverberation on a source should sound. Setting this value to 1 will make a source always sound completely outdoors, while setting it to -1 will make a source sound completely indoors.

Attaching the AcousticsAdjustExperimental script to a source enables additional experimental tuning parameters for that source. To attach the script, click Add Component on the bottom of the Inspector panel and navigate to Scripts > Acoustics Adjust Experimental. There is currently one experimental control:

Screenshot of Unity AcousticsAdjustExperimental script

  • Perceptual Distance Warp - Apply an exponential warping to the distance used to compute the dry-wet ratio. The acoustics system computes wet levels throughout the space, which vary smoothly with distance and provide perceptual distance cues. Warping values greater than 1 exaggerate this effect by increasing distance-related reverberation levels, making the sound "distant". Warping values less than 1 make the distance-based reverberation change more subtle, making the sound more "present".

Design acoustics for all sources

To adjust parameters for all sources, click on the channel strip in Unity's Audio Mixer, and adjust the parameters on the Project Acoustics Mixer effect.

Screenshot of Project Acoustics Unity Mixer customization panel

  • Wetness Adjust - Adjusts the reverb power, in dB, across all sources in the scene based on source-listener distance. Positive values make a sound more reverberant, while negative values make a sound more dry.
  • RT60 Scale - Multiplicative scalar for reverb time.
  • Spatializer - Controls whether audio is output as binaural (0) or multichannel panning (1). Any value besides 1 indicates binaural. Binaural output is spatialized with HRTFs for use with headphones and multichannel output is spatialized with VBAP for use with multichannel surround speaker systems. If using the multichannel panner, be sure to select the speaker mode that matches your device settings, found under Project Settings > Audio.

Check proper sound source placement

Sound sources placed inside or very near geometry may fail to get acoustic parameters. This can be resolved by moving the source further away from geometry.

Screenshot of Unity Gizmos menu

Sometimes sound sources may be mistakenly fail as if they were inside geometry if the Acoustics data does not align with the visual components of the game. To determine if this is the case, you can view Project Acoustics voxels by toggling the voxel grid checkbox in the Gizmos menu, in the upper right of the Scene view. If visual components in the game have a transform applied to them, you can apply the same transform to the GameObject hosting the Acoustics Manager to correct the issue.

Next steps

  • Explore case studies highlighting the concepts behind the design process