Skip to content

AudioLink API

Two halves, with opposite rules:

  • Read the live band levels (bass → treble) — client-local, for your own local visual logic.
  • Set the AudioLink tuning (gain, EQ, sensitivity, trails) — server-authoritative, so a change syncs to everyone (e.g. an in-world tablet).

Reading bands — client-local

Read the world's live audio as four band levels, each 0..1. Reach for this over the drop-on Audio Reactive component when you want custom logic (combine bands, thresholds, your own curves).

The READS are client-local — never sync them

Every player's client reads their own audio, so these values are different for each player and are 0 on the server and in a world with no AudioLink. Use them ONLY for local, cosmetic effects. Never feed a band into a moving object's position, a world/player variable, or anything networked — the server reads 0, so it desyncs. (The setters below are the opposite: those ARE synced.)

float b  = AudioLink.Bass();         // 0..1  — also LowMid(), HighMid(), Treble()
float t  = AudioLink.GetBand(3);     // 0..1  — by index: 0=Bass, 1=LowMid, 2=HighMid, 3=Treble
bool  on = AudioLink.IsAvailable();  // true while a local analyzer is running
Call Returns What it gives you
AudioLink.Bass() · LowMid() · HighMid() · Treble() float 0..1 that band right now
AudioLink.GetBand(band) float 0..1 a band by index (03)
AudioLink.IsAvailable() bool is a local analyzer running
// Local, cosmetic: each player drives their own copy of the light from their own audio.
protected override void Update()
{
    myLight.intensity = 0.2f + AudioLink.Bass() * 4f;
}

You don't guard for the server — off the client Bass() is simply 0, so the light sits at rest and nothing throws.

Setting the tuning — synced

These change the AudioLink tuning — the shader response that AudioLink-aware shaders read — and are server-authoritative: call one from anywhere and the platform applies it and broadcasts, so every player sees the same tuning, and late joiners get the current values. Safe to drive from an in-world control (unlike the reads). Values are clamped; the server rate-limits, so throttle rapid slider sends.

Call Range What it does
AudioLink.SetGain(v) 0..2 overall gain
AudioLink.SetBass(v) 0..2 bass EQ
AudioLink.SetTreble(v) 0..2 treble EQ
AudioLink.SetSensitivity(v) 0..1 per-band sensitivity (higher = more reactive)
AudioLink.SetTrails(v) 0..1 trail / fade length
AudioLink.SetAutoGain(on) bool auto-normalize on/off
AudioLink.Reset() back to the world's authored tuning

Example — an in-world tuning tablet

Build a tablet with UI sliders and wire each slider's On Value Changed (in the inspector) to one of these — exactly how you'd wire a video player's volume slider. The player using the tablet triggers it; the server applies it and everyone's AudioLink updates together, synced automatically — no manual sync.

public void OnGain(float v)        { AudioLink.SetGain(v); }        // 0..2
public void OnBass(float v)        { AudioLink.SetBass(v); }        // 0..2
public void OnTreble(float v)      { AudioLink.SetTreble(v); }      // 0..2
public void OnSensitivity(float v) { AudioLink.SetSensitivity(v); } // 0..1 — higher = more reactive
public void OnTrails(float v)      { AudioLink.SetTrails(v); }      // 0..1
public void OnAutoGain(bool on)    { AudioLink.SetAutoGain(on); }
public void OnResetPressed()       { AudioLink.Reset(); }

The setters tune the shader response (what AudioLink-aware shaders show). The no-code Audio Reactive bands follow that component's own settings.

When to use which

  • Audio Reactive component — no scripting: pick a band → drive a light / material / scale.
  • AudioLink read API — custom local logic from the bands (client-local; keep brightness effects gentle — strobing is a comfort hazard).
  • AudioLink setters — a synced control surface (a tablet) for the whole world's tuning.