Ducking background music for other audio

Hey everyone,

Im a bit new with fmod and im working on a 3D game in unity. I have an emitter placed in a house that plays different music from the regular background music which right now plays the new song when you get closer to the house and also becomes louder the closer you get. What i would like to do is make the background music lower as you get closer to the house. The background music is attached to its own object atop the level at the moment.

Off the top of my head, there’s two easy ways to do this.

The best option for your situation is probably to put your background music event emitter right on top of your house, and give it a custom attenuation curve such that it gets quieter when the listener gets within a certain distance of it. (To do this, add a ‘Distance’ built-in parameter to the music event, then automate the event’s volume on that parameter such that it’s at full volume at max distance.) Note that if the listener is further away from your emitter than the maximum value of the event’s distance parameter, it will act as if it’s at the maximum value of its distance parameter, and the volume of the event will be based on the automation curve at that point.

The second option is a little more memory-intensive and somewhat less cusomisable: Sidechaining. First, make sure that each of your music events feeds into a different bus in the mixer. Then, place a sidechain compressor in the signal chain of the bus that plays your game’s regular background music, and a sidechain in the bus that plays your special house music. This will allow you to automatically duck the output of the first bus when there’s content playing through the second bus.

1 Like