Balancing in-game audio with Ducking
As much as the background music can be important in establishing the right atmosphere, there will be times when other audio clips should be emphasized, and the music volume turned down for the duration of that clip. This effect is known as Ducking. Maybe you will need it for dramatic effect (simulating hearing loss after an explosion took place), or maybe you want to make sure that the player listens to a specific bit of information. In this recipe, we will learn how to emphasize a piece of dialog by ducking the audio whenever a specific sound message is played. For that effect, we will use the new Audio Mixer to send information between tracks.
Getting ready
For this recipe, we have provided the soundtrack.mp3
audio clip and a Unity package named Ducking.unitypackage
, containing an initial scene. All these files are available inside the 1362_09_07
folder.
How to do it...
To apply Audio Ducking to your soundtrack, follow these steps:
- Import
Ducking.unitypackage...