Skip to content
DEV505 / Sound ManagerDOCUMENTATION

DEV505 / SOUND LAB / 04

A little drive.

Shape layered loops with RPM, load, and signals.

The throttle is at 92% and the engine has climbed above 6,000 RPM. The demo updates Rpm and Load while the engine layers continue playing.
Engine in Unity: more throttle, higher RPM. The real scene controls and status readouts are visible.

The throttle is at 92% and the engine has climbed above 6,000 RPM. The demo updates Rpm and Load while the engine layers continue playing.

In Unity’s Project window, open Assets/DEV505/SoundManager/Samples/04-Engine/Demo.unity. The supplied scene already has its Sound Manager, event registrations, generated keys, camera, and Audio Listener. Press Play, wait for the demo to be ready, and click the Game view before using the keyboard. If you are setting up a separate scene, follow Your first sound first.

Control Action
Space / engine button Start or stop the engine.
W / Up Apply throttle.
S / Down Brake.
G Change gear through the four demo gears.
H Sound the horn.
HUD throttle slider, brake, gear, and horn buttons Control the same interaction with the mouse.

Start the engine and listen at idle. Raise the throttle, change gear, then brake. The sound climbs and settles as the parameters change. Press H while driving: the horn plays over the engine without restarting it. Stop the engine to hear its shutdown response.

The listener is the scene’s fixed listening point, and the engine follows the car. The saved 3D distance range is 3.2–14 units, chosen for this small island.

The engine is running at about 950 RPM with no throttle. The scene keeps the Engine play available for changing parameters and receiving signals.
Engine in Unity: the engine idles. The real scene controls and status readouts are visible.

The engine is running at about 950 RPM with no throttle. The scene keeps the Engine play available for changing parameters and receiving signals.

The car is now in second gear after the Shift and Horn signals. Their short sounds can play alongside the engine loops.
Engine in Unity: a horn and a gear change. The real scene controls and status readouts are visible.

The car is now in second gear after the Shift and Horn signals. Their short sounds can play alongside the engine loops.

The groups separate ignition, running layers, Horn and Shift signals, and the shutdown sound.
Engine in Unity: the complete Engine graph. The graph nodes and their connections are visible.

The groups separate ignition, running layers, Horn and Shift signals, and the shutdown sound.

The engine’s playback branches layer recordings instead of switching abruptly between a single idle file and a single fast file. Rpm feeds value-mapping nodes that shape playback speed and layer volume. Load adds the sound of working harder. Follow the colored value connections from each parameter to the playback inputs; the execution connections decide when those voices start or stop.

The normalized Rpm value changes playback speed and the balance of the engine layers. Remap Float converts its 0–1 input into the range needed by the sound.
Engine in Unity: turn RPM into sound controls. The graph nodes and their connections are visible.

The normalized Rpm value changes playback speed and the balance of the engine layers. Remap Float converts its 0–1 input into the range needed by the sound.

Load passes through a remapping node and is multiplied with the layer's volume control. This lets throttle affect the sound without starting a new event.
Engine in Unity: add the engine load. The graph nodes and their connections are visible.

Load passes through a remapping node and is multiplied with the layer's volume control. This lets throttle affect the sound without starting a new event.

Both parameters are normalized: 0–1. The HUD’s roughly 950–6500 RPM display is calculated by the controller. Do not pass a displayed RPM value such as 6000 into SoundParameters.Engine.Rpm. The graph expects a fraction of the working range.

The parameter state has a target and a current value. SetFloat changes the target; the runtime moves the current value toward it using the graph’s rise/fall rates. Rpm rises at 0.8 units per second and falls at 1.5, so letting go can settle faster than accelerating. Load responds faster still. This avoids abrupt sound jumps when input changes.

Start with known values · excerpt
var context = SoundPlayContext.Following(car, service.OwnerOf(this))
.With(SoundParameters.Engine.Rpm, 0f)
.With(SoundParameters.Engine.Load, 0f);
var result = SoundBus.Play(Sounds.Engine, context);

Here car is the car Transform and service is the ready active sound service. Retain the accepted handle as engine, then update that play:

Live controls · excerpt
SoundBus.SetFloat(engine, SoundParameters.Engine.Rpm, targetRpm);
SoundBus.SetFloat(engine, SoundParameters.Engine.Load, targetLoad);
SoundBus.SendSignal(engine, "Horn");

The two target variables are values between 0 and 1. Send Horn only for the horn action, not every frame. Shift works in the same way with the exact signal name "Shift".

Each On Signal node triggers a short cue. The running engine does not need to stop for either signal.
Engine in Unity: respond to Horn and Shift. The graph nodes and their connections are visible.

Each On Signal node triggers a short cue. The running engine does not need to stop for either signal.

On Signal responds inside the existing play, adding the horn or gear-change cue. A signal is an instruction to that graph, not another call to Play the entire engine. Stopping the retained engine reaches the graph’s On Stop shutdown path. The complete recipe also unsubscribes from notifications and cleans up when disabled.

Throttle input, gears, speed simulation, wheel rotation, rocking, and the displayed RPM belong to EngineDriveDemo. It reads the smoothed audio parameter for consistent feedback, but Sound Manager is not a vehicle physics system. The graph owns sound layering, mapping, smoothing, signal responses, and shutdown.

  • The engine always sounds at maximum. Send normalized values, not the HUD’s displayed RPM.
  • A horn press restarts the engine. Send Horn to the retained handle instead of starting another Engine play.
  • The parameter does not jump to the requested value. Check Current versus Target; smoothing is intentional.
  • A signal does nothing after shutdown. A stale handle no longer represents a running graph. Start an accepted play first.

These are the saved graph settings. A play can supply different initial parameter values. Float smoothing is measured in units per second; a rate of 0 applies changes immediately.

Sounds.Engine

Position
3D · 3.2–14 units (minimum–maximum distance)
Overlapping plays
2 · ReplaceOldest
Cooldown
None
Owner loss
Stop
Keep Alive
Off — ends when its work is finished
ParameterTypeDefaultRangeRise / fall rate
RpmFloat00–10.8 / 1.5
LoadFloat00–12 / 3
SignalResponse in this graph
HornAdd the horn cue to this running engine.
ShiftAdd the gear-change cue to this running engine.

For the meaning of these settings, see Playback settings. The default numbers above come from the Unity graph audit stored with this documentation.

Open the complete integration recipe for the script, Inspector setup, a short test, and cleanup. Use Play context for initial values and placement, and SoundBus for playback controls.

All Engine Unity captures includes further states and readable graph details, with steps to reproduce each view.