FMOD & Wwise
Every engine can play a sound file. Audio middleware goes further: the sound designer builds behaviour (random variations, layers that react to game parameters, music that changes section on the beat, mixer snapshots) in a dedicated tool, and the game only sends events and parameters. The two dominant products are FMOD (Firelight Technologies) and Wwise (Audiokinetic). Both have free tiers for small or non-commercial projects and paid licences above budget or revenue thresholds; check each vendor's current licensing terms before you commit.
Why teams use middleware
| Without middleware | With FMOD / Wwise |
|---|---|
| Programmer picks one of five footstep files at random in code | designer builds a random container with pitch/volume variation; code posts Footstep |
| Engine speed → code crossfades three loops | designer draws volume curves against an RPM parameter |
| Music changes by stopping one track and starting another | transitions on bar lines, stingers, layered intensity |
| Mixing by editing code and rebuilding | live mixing while the game runs (both tools connect to a running build) |
| Per-platform compression in the engine importer | per-platform conversion settings, banks / SoundBanks loaded per level |
The trade-off: another tool to learn, licence, integrate and keep in version control (both tools' projects are mostly XML/text and diff reasonably).
The vocabulary side by side
| Concept | FMOD Studio | Wwise |
|---|---|---|
| What code triggers | Event (event:/SFX/Footstep) |
Event (Play_Footstep), which runs actions on objects |
| Game value that shapes sound | Parameter (local or global) | RTPC (Game Parameter) |
| Discrete game state | parameter with labels, or snapshot | State (global) and Switch (per game object) |
| Mixer | buses, VCAs, snapshots | busses, auxiliary sends, States on busses |
| Packaged data | banks (.bank, plus Master.strings.bank for path lookups) |
SoundBanks |
| Engine integrations | Unity, Unreal (official), Godot (community GDExtension) | Unity, Unreal (official), Godot (community integration) |
Game code with FMOD in Unity
The FMOD for Unity integration adds an EventReference type you pick in the Inspector, a StudioEventEmitter component, and the RuntimeManager static class:
using FMODUnity;
using UnityEngine;
public class Car : MonoBehaviour
{
[SerializeField] EventReference engineEvent; // e.g. event:/Vehicles/Engine
[SerializeField] EventReference hornEvent;
FMOD.Studio.EventInstance engine;
void Start()
{
engine = RuntimeManager.CreateInstance(engineEvent);
engine.set3DAttributes(RuntimeUtils.To3DAttributes(gameObject));
engine.start();
}
void Update()
{
engine.set3DAttributes(RuntimeUtils.To3DAttributes(gameObject));
engine.setParameterByName("RPM", CurrentRpm()); // the designer's curves do the rest
if (Input.GetKeyDown(KeyCode.H)) // (use the Input System in a real project)
RuntimeManager.PlayOneShot(hornEvent, transform.position);
}
void OnDestroy()
{
engine.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
engine.release(); // every CreateInstance needs a release
}
float CurrentRpm() => 3000f;
}Game code with Wwise in Unity
The Wwise Unity integration exposes typed fields (AK.Wwise.Event, AK.Wwise.RTPC, AK.Wwise.State, AK.Wwise.Switch) you assign in the Inspector, and each game object that emits sound is registered with the sound engine (the AkGameObj component keeps its position up to date):
using UnityEngine;
public class Footsteps : MonoBehaviour
{
public AK.Wwise.Event footstep; // Play_Footstep
public AK.Wwise.Switch surfaceGravel; // Surface / Gravel
public AK.Wwise.RTPC speed; // Player_Speed
public void OnFootDown(float currentSpeed) // called from an animation event
{
surfaceGravel.SetValue(gameObject);
speed.SetValue(gameObject, currentSpeed);
footstep.Post(gameObject);
}
}In Unreal, both tools ship plugins with Blueprint nodes and components (FMOD's FMOD Audio Component and Play Event nodes; Wwise's AkComponent and Post Event nodes). See Unreal Engine 5 with C++ for engine-side audio.
A runnable model: parameter curves
What a designer draws in FMOD or Wwise is, underneath, a set of curves: for each layer, volume as a function of a parameter. Here's an engine sound with three loops crossfading over RPM, the classic example:
def curve(points, x):
"""piecewise-linear automation curve: points = [(x, value), ...] sorted by x"""
if x <= points[0][0]:
return points[0][1]
for (x0, y0), (x1, y1) in zip(points, points[1:]):
if x <= x1:
return y0 + (y1 - y0) * (x - x0) / (x1 - x0)
return points[-1][1]
layers = {
"idle loop": [(800, 1.0), (1500, 1.0), (2500, 0.0)],
"mid loop": [(1500, 0.0), (2500, 1.0), (4000, 1.0), (5000, 0.0)],
"high loop": [(4000, 0.0), (5000, 1.0), (7000, 1.0)],
}
pitch = [(800, 0.8), (7000, 1.3)]
print(" RPM | " + " | ".join(f"{name:>9}" for name in layers) + " | pitch")
for rpm in [800, 2000, 2500, 4500, 6500]:
vols = [curve(pts, rpm) for pts in layers.values()]
print(f"{rpm:5} | " + " | ".join(f"{v:9.2f}" for v in vols) + f" | {curve(pitch, rpm):5.2f}") RPM | idle loop | mid loop | high loop | pitch
800 | 1.00 | 0.00 | 0.00 | 0.80
2000 | 0.50 | 0.50 | 0.00 | 0.90
2500 | 0.00 | 1.00 | 0.00 | 0.94
4500 | 0.00 | 0.50 | 0.50 | 1.10
6500 | 0.00 | 0.00 | 1.00 | 1.26
The game code only ever sets RPM. Changing the sound (more layers, different crossfade points) is a change in the middleware project, not in code.
Voice limiting
Both tools limit how many instances of an event can play at once and decide what to drop (oldest, quietest, furthest). Without it, twenty simultaneous gunshots are just noise and cost CPU:
MAX_VOICES = 3
playing = [] # (start_frame, distance)
def play(frame, distance):
global playing
if len(playing) < MAX_VOICES:
playing.append((frame, distance))
return "play"
furthest = max(playing, key=lambda v: v[1])
if distance < furthest[1]:
playing.remove(furthest)
playing.append((frame, distance))
return f"steal voice at {furthest[1]} m"
return "drop (all voices closer)"
for frame, dist in [(0, 12), (1, 30), (2, 5), (3, 40), (4, 8), (5, 50)]:
print(f"frame {frame}: gunshot at {dist:2} m -> {play(frame, dist)}")
print("now playing:", sorted(d for _, d in playing))frame 0: gunshot at 12 m -> play
frame 1: gunshot at 30 m -> play
frame 2: gunshot at 5 m -> play
frame 3: gunshot at 40 m -> drop (all voices closer)
frame 4: gunshot at 8 m -> steal voice at 30 m
frame 5: gunshot at 50 m -> drop (all voices closer)
now playing: [5, 8, 12]
Test yourself
In FMOD, what is the equivalent of a Wwise RTPC?
- A bank
- A parameter
- A bus
- A snapshot
With FMOD for Unity, what must follow every RuntimeManager.CreateInstance?
- A PlayOneShot
- A release() when the instance is no longer needed
- Loading Master.bank
- Nothing
What is the main benefit of driving an engine sound with a parameter instead of code that crossfades loops?
- It is faster to compile
- The sound designer can change layers and curves without code changes
- It uses less disk space
- It removes the need for banks