MicVolumeToFishSpeed — Parameter Reference

Maps live microphone volume to fish follow speed each frame. Volume is read from a SimpleSpectrum instance, auto-calibrated against ambient noise, and smoothed before being applied to any number of PlayerFishControllers.

Signal Flow
How a mic sound becomes a fish speed value
1 · Input
Microphone → SimpleSpectrum
2 · RMS
Output bars averaged to
single volume value (0–1)
3 · Calibration
Volume remapped against
auto-detected noise floor
4 · Speed Map
[minVolume → maxVolume]

[minSpeed → maxSpeed]
5 · Smoothing
Attack / Decay RC filter
prevents jarring snaps
6 · Output
CurrentSpeed → each
PlayerFishController
References
Inspector — References
Spectrum SimpleSpectrum null
The SimpleSpectrum component that reads from the microphone. Must be configured with SourceType = MicrophoneInput and isEnabled = true at runtime. This is the sole audio source — no Unity AudioSource or Microphone API is touched directly.
Required. Without this, the component outputs minSpeed constantly.
Auto-Calibration
Inspector — Auto-Calibration
Calibration Duration float (seconds) 1.5
How long the component listens to ambient noise on startup before setting volume thresholds. During this window fish stay at minimum speed — the calibration is silent from the player's perspective. After the window closes, minVolume is set to the averaged ambient RMS.
Longer = more stable noise floor, but fish are slow at the start of each session. 1–2 s is a good default. Increase if the mic takes time to warm up.
Max Volume Multiplier float (×) 4
After calibration: maxVolume = ambientRMS × this value. A value of 4 means the player must be 4× louder than ambient to reach full speed. A value of 2 makes full speed easier to hit; 8 requires very loud input.
Easy (2×)
Loud (8×)
Lower = more responsive to quiet environments. Raise this if players in a noisy space keep accidentally hitting max speed.
Min Volume Floor float (0–1) 0.001
Absolute lower bound for minVolume. Prevents instability when the mic picks up near-zero signal (e.g. muted input, bad hardware). If the calibrated ambient RMS falls below this value, this floor is used instead.
Rarely needs changing. Only raise it if you see erratic speed behavior with a very quiet mic.
Speed Range
Inspector — Speed Range
Min Speed float (wu/s) 1
Fish follow speed when the room is at ambient noise level (or below). This is the resting speed — the fish still moves toward its light at this rate during silence. Set to 0 for a fully stopped fish at silence, or higher to keep the fish always responsive.
Max Speed float (wu/s) 10
Fish follow speed at peak volume (when input reaches maxVolume). Should be balanced against the maze's cell size — too high and the fish will overshoot corners and struggle to navigate.
Also used by PlayerFishController's particle emission when Use Driver Speed Range is enabled — particles scale proportionally with this same range.
Disabled Speed float (wu/s) 4
Constant speed output when the mic is set to None (i.e. mic-driven mode is off). This is passed directly as CurrentSpeed with no smoothing applied. Should match the Follow Speed field on the paired PlayerFishController so there is no jump when toggling between mic and no-mic mode.
Smoothing
Inspector — Smoothing
Attack Time float (seconds) 0.08
How quickly speed rises when the player gets louder. Implemented as an exponential RC filter: smaller values = snappier attack. At 0.08 s the fish responds to a shout almost instantly.
Instant (0.01)
Sluggish (0.5+)
Keep Attack short (0.05–0.15 s) so players feel an immediate reaction when they speak.
Decay Time float (seconds) 2.5
How slowly speed falls after the player goes quiet. A long decay makes the fish coast at high speed briefly after a burst of sound — rewarding sustained vocalization and preventing jerky stop-start motion.
Snappy (0.3)
Long (5+)
A longer decay (2–4 s) feels more fluid and forgiving. Shorter values give a more direct, arcade feel.
Camera Background Color
Inspector — Camera Background Color
Enable Color Lerp bool true
Master switch for background color feedback. When off, the camera background is never touched.
Background Camera Camera null
The camera whose backgroundColor is lerped each frame. The component forces Clear Flags → Solid Color automatically so the tint is always visible. Leave unassigned to disable color feedback even if Enable Color Lerp is on.
Bg Color Min Color black
Background color when fish speed equals minSpeed (silence).
Bg Color Max Color (0.1, 0.2, 0.5)
Background color when fish speed equals maxSpeed (peak volume). The lerp uses the same 0–1 t value as the speed mapping, so color and fish speed always track each other exactly.
Debug Fields (Inspector Read-Only)
Is Calibrating True during the startup noise-floor sample window. Fish hold at min speed.
Debug Ambient RMS The averaged ambient noise level measured during calibration. Becomes minVolume.
Debug Current Volume Live RMS of the spectrum output this frame (0–1). Useful for checking mic sensitivity.
Debug Min Volume The calibrated lower threshold. Volume at or below this → minSpeed.
Debug Max Volume The calibrated upper threshold (ambientRMS × maxVolumeMultiplier). Volume at or above this → maxSpeed.
Debug Current Speed The smoothed speed value being sent to fish controllers right now.
Debug Color T 0–1 blend value fed into the background color lerp. 0 = Bg Color Min, 1 = Bg Color Max.
Tuning Scenarios

Fish feels unresponsive to voice

Lower Max Volume Multiplier (try 2) so full speed is easier to reach. Also lower Attack Time (try 0.04) for a snappier rise. Check Debug Current Volume — if it barely moves when you speak, the mic gain may be too low in SimpleSpectrum.

Fish zooms off at ambient noise

The noise floor calibration may have completed too early or in a noisy environment. Re-run calibration with RecalibrateAmbient() in a quieter moment. Increase Max Volume Multiplier (try 6–8) to widen the dead zone between ambient and full speed.

Speed drops too fast between sounds

Increase Decay Time (try 3–5 s). This lets the fish coast at high speed for longer between bursts, giving players time to breathe without losing momentum.

Fish too slow / too fast overall

Adjust Min Speed and Max Speed directly. Remember: if Use Driver Speed Range is on in PlayerFishController, the particle emission range will also shift automatically to match.

Using without a microphone

Set mic to None via the debug UI (calls SetMicDisabled(true)). Fish will move at Disabled Speed constantly. Make sure this matches the Follow Speed on PlayerFishController.

Multiple fish, one mic

Place a single MicVolumeToFishSpeed on a shared manager object. Assign it to the Mic Volume Driver field on each PlayerFishController. Both fish will respond to the same voice simultaneously.