Skip to content
DEV505 / Sound ManagerDOCUMENTATION

DEV505 / SOUND LAB / 03

A little buzz.

Follow a tiny moving emitter through 3D space.

The bee is flying on the right side of the listener. The demo starts one looping buzz with a context that follows the bee Transform.
Bee in Unity: the bee passes on the right. The real scene controls and status readouts are visible.

The bee is flying on the right side of the listener. The demo starts one looping buzz with a context that follows the bee Transform.

In Unity’s Project window, open Assets/DEV505/SoundManager/Samples/03-Bee/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 Release or recall the bee.
Release bee / Recall bee The same action from the HUD.

Use headphones if possible. Release the bee, listen as it crosses to either side, and compare the distance shown in the HUD. Recall it to end the moving buzz. The listener represents you at the central DEV505 player, rather than the distant scene camera. Its orientation decides which direction is heard on the left and right.

The bee rests on its flower. The listener is at the player in the center, so the distance readout measures from there.
Bee in Unity: ready to fly. The real scene controls and status readouts are visible.

The bee rests on its flower. The listener is at the player in the center, so the distance readout measures from there.

The same flight continues around the player. Following the Transform updates the sound position as the bee moves; it does not start a new buzz each frame.
Bee in Unity: the bee passes on the left. The real scene controls and status readouts are visible.

The same flight continues around the player. Following the Transform updates the sound position as the bee moves; it does not start a new buzz each frame.

On Start begins the looping bee clip. WingSpeed controls its playback speed. The moving position comes from the play context supplied by the demo script.
Bee in Unity: one buzz with a changing speed. The graph nodes and their connections are visible.

On Start begins the looping bee clip. WingSpeed controls its playback speed. The moving position comes from the play context supplied by the demo script.

The graph starts a looping recording and connects WingSpeed to playback speed. Increasing that value makes the buzz faster and higher pitched; it does not move the bee through the scene. The recording is imported for a mono spatial source. A single emitter position lets Unity place it relative to the listener.

Spatial blend is 1, with linear distance falloff from 0.8 to 4 world units and Doppler set to 0.3. These are the event settings used by the moving bee.
Bee in Unity: make the buzz a 3D sound. The saved event values are visible in the Inspector.

Spatial blend is 1, with linear distance falloff from 0.8 to 4 world units and Doppler set to 0.3. These are the event settings used by the moving bee.

Spatial blend is fully 3D. The saved distance range is 0.8–4 units with linear rolloff: after the near distance, moving farther away reduces the level. Doppler is 0.3, adding a modest pitch change from relative movement. These settings and the listener’s position matter more than the camera’s view of the island.

The demo’s essential call is:

Following a bee · excerpt
var context = SoundPlayContext.Following(bee)
.With(SoundParameters.Bee.WingSpeed, 1f);
var result = SoundBus.Play(Sounds.Bee, context);

bee is the Transform moved by the flight controller. Keep result.Handle only after checking result.Accepted. Following retains a reference to that Transform; the runtime reads it while the play is alive and updates its voices. It does not capture only the starting position. By contrast, SoundPlayContext.At(position) uses a fixed position.

To recall the bee, stop the retained play with SoundBus.Stop. This graph’s owner-loss policy is Stop, so destroying its follow target also ends playback. Following(bee) alone does not assign an explicit owner token. The complete recipe adds an owner for convenient object-wide cleanup and demonstrates how to change WingSpeed while buzzing.

Flight paths, wing flapping, the flower perch, distance label, and glowing player are sample visuals and animation. Sound Manager follows the Transform and plays the graph. It does not calculate the bee’s route or simulate its wings. The event permits one Bee play; starting another replaces the old one.

  • The buzz stays in one place. Use Following with the bee Transform, not At with a copied position.
  • It sounds centered or too quiet. Check the active Audio Listener, fully 3D settings, and the small distance range. Avoid a second listener on another camera.
  • It keeps restarting. Play once, retain the handle, and move the Transform. Repeated Play calls replace the current buzz.
  • WingSpeed changes instantly. This parameter has zero rise/fall smoothing in the saved graph. The flight animation’s smoothing is separate.

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.Bee

Position
3D · 0.8–4 units (minimum–maximum distance)
Overlapping plays
1 · ReplaceOldest
Cooldown
None
Owner loss
Stop
Keep Alive
Off — ends when its work is finished
ParameterTypeDefaultRangeRise / fall rate
WingSpeedFloat10.7–1.50 / 0

Signals: None authored.

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 Bee Unity captures includes further states and readable graph details, with steps to reproduce each view.