Fmod Unity



FMOD for Unity This content is hosted by a third party provider that does not allow video views without acceptance of Targeting Cookies. Please set your cookie preferences for. I've been using Wwise and I don't exactly see what's so great about it? Everything I've done so far I could've done in Unity and easier. I get that you can design audio with their software and integrate it into Unity but it's such a long process, when I could've just drag and drop my audio files Unity and edit it in another software if I wanted to (which I haven't found the need to do so).

The FMOD mixer can be controlled with all its functions in Unity. In this tutorial we change the volume of buses, VCAs and trigger snapshots directly from Unity using code.

Download the Unity & FMOD Project for this tutorial. If you get any errors after opening the project, please delete the FMODStudioCache.asset file, as it will still contain the old path to the FMOD Studio Project.

Check out the video version of this tutorial:

Table of Contents

  • FMOD Studio Bus volume control in Unity

FMOD Studio Bus volume control in Unity

The volume of a bus in Unity can be controlled in three simple steps:

  1. Declare bus
  2. Get the bus path
  3. Adjust the volume of the bus

Let’s take a closer look at these steps.

Declaring an FMOD Bus

Just as with simple instances, we have to declare the bus first:

Retrieving the Bus

Now we can call our desired Bus in Unity’s Start() method:

bus:/MusicBus is a string and refers to the groups created in the routing tab in the FMOD Studio Mixer. We can copy this path by right-clicking on the group and selecting the Copy Path option:

Adjusting the volume of a Bus

In the Update() method we can now set our desired volume for the bus by using Bus.setVolume. setVolume takes a float number ranging from 0 (mute) to 1 (full volume). Of course it is also possible to work with the dB scale. Therefore we declare two floats:

busVolume is a float that we can control via a slider in the inspector. It should represent our desired dB volume value. With volume we use a formula to convert dB to a linear scale:

The complete script for the bus looks like this:

FMOD Studio VCA volume control in Unity

FMOD Studio gives us the ability to couple busses to specific VCAs. Motogp download torrent. This is useful, for example, when we want to control the volume of music and sound effects separately. From a code perspective, the volume control works the same as for the busses. But this time we declare a VCA:

Instead of GetBus() we use GetVCA():

Then we use the setVolume() method again to change the volume of the VCA:

Fmod Designer Download

The complete script for the VCAs looks like this:

Trigger FMOD Snapshots in Unity

Fmod Unity

Snapshots also behave mostly like normal events. Triggering snapshots is really like manually playing 2D/3D events.

First we declare the snapshot instance:

Fmod Unity Tutorial

Then we create the instance and play or stop it in Unity’s Update() method:

Fmod Unity Integration

As you can see here, only the path of the event changes. Instead of event:/ we now use snapshot:/ to point to the correct path. Have a look at the attached project to experiment with the snapshots yourself.





Comments are closed.