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.
SourceType = MicrophoneInput and
isEnabled = true at runtime. This is the sole audio source —
no Unity AudioSource or Microphone API is touched directly.
minSpeed constantly.
minVolume is set to the averaged ambient RMS.
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.
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.
0 for a fully stopped fish at silence, or higher to keep
the fish always responsive.
maxVolume).
Should be balanced against the maze's cell size — too high and the fish
will overshoot corners and struggle to navigate.
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.
0.08 s the fish responds to a shout almost instantly.
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.
minSpeed (silence).
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.
| 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. |
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.
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.
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.
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.
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.
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.