Simulating acoustic environments with Reverb Zones

Once you have created your level's geometry and the scene is looking just the way you want it to, you might want your sound effects to correspond to that look. Sound behaves differently depending upon the environment in which it is projected, so it can be a good idea to make it reverberate accordingly. In this recipe, we will address this acoustic effect by using Reverb Zones.

Getting ready

For this recipe, we have prepared the ReverbZone.unitypackage file, containing a basic level named reverbScene and the Signal prefab. The package is in the 1362_09_02 folder in the code bundle.

How to do it...

Follow these steps to simulate the sonic landscape of a tunnel:

  1. Import the ReverbZone package into your Unity Project.
  2. In the Project view, open the reverbScene level, inside the ReverbZones folder. This is a basic scene, featuring a controllable character and a tunnel.
  3. Now, drag the Signal prefab from the Project view into Hierarchy, as shown in the following screenshot. This will add a sound-emitting object to the scene. Place it in the center of the tunnel.
    How to do it...
  4. Make five copies of the Signal GameObject and distribute them across the tunnel (leaving a copy just outside each entrance):
    How to do it...
  5. In in the Hierarchy view, navigate to Create | Audio | Audio Reverb Zone to add a Reverb Zone to the scene. Then, place it in the center of the tunnel.
  6. Select the Reverb Zone GameObject. In the Inspector view, change the Reverb Zone component parameters to these values: Min Distance: 6; Max Distance: 18; and Preset: StoneCorridor as shown in the following screenshot:
    How to do it...
  7. Play the scene and walk through the tunnel using the W A S D keys ( and pressing Shift to run). You will hear the audio reverberate when inside the Reverb Zone area.

How it works...

Once positioned, the Audio Reverb Zone applies an audio filter to all audio sources within its radius.

There's more...

Here are more options for you to try.

Attaching the Audio Reverb Zone component to Audio Sources

Instead of creating an Audio Reverb Zone GameObject, you can attach it to the sound emitting object (in our case, Signal) as a component through the Component | Audio | Audio Reverb Zone menu. In this case, the Reverb Zone will be individually set up around the object.

Making your own Reverb settings

Unity comes with several Reverb Presets. We have used StoneCorridor, but your scene can ask for something less intense (such as Room) or more radical (such as Psychotic). If these presets still won't be able to recreate the effect that you have in mind, change it to User and edit its parameters as you wish.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.226.66