Diagnostic

Audio Self-Test

End-to-end loopback test: plays a known multi-tone probe and captures the live microphone, then runs an FFT on both signals and checks every expected peak. A full pass proves not just that audio works, but that the whole speaker → ear-equivalent → mic chain is intact across the frequency band tested.

What this test does

  1. Production — synthesizes a composite signal: a sum of pure sine waves at well-spaced frequencies (so each lands in a distinct FFT bin) and plays it through the speakers / headphones.
  2. Consumption — requests microphone permission, opens the live capture stream, and runs an FFT on it.
  3. Per-peak verification — for every test frequency, checks the FFT bin amplitude and its local signal-to-noise ratio. PASS for each tone independently; the overall loop-closure verdict is the AND of all expected peaks.
  4. Hardware envelope plot — shows the detected amplitude at each test frequency as a bar chart. Reveals where the speaker, mic, codec, or Bluetooth chain rolls off — not just whether some tone got through.

With headphones on, the test will still pass through bone / ambient conduction but the peaks may be quieter. For a cleaner loopback, briefly remove the headphones before running.

About the ultrasonic profile: probes above ≈ 16–18 kHz commonly get attenuated by AAC / Opus codecs, Bluetooth, and consumer speaker / mic hardware. Frequencies above 20 kHz are above most human hearing. A non-zero detection at these bins proves the chain still carries energy that high; a missing detection isn’t a hard failure — it is evidence about the hardware’s upper limit.

Loopback test

Most devices ignore unusual sample rate requests; the report shows what the OS actually delivered. iOS Safari hides individual device labels until mic permission is first granted — click or tap Run test once, then come back and the dropdowns will populate.

Generated signal — live spectrum (snapshot)

Running max ≥ threshold: (snapshot fluctuates; the count is over the whole test duration)

Microphone input — live spectrum (snapshot)

Running max ≥ threshold:

Multi-tone phase (FDM)

Bar chart: peak amplitude detected at each discrete test frequency. Bars cropped near zero indicate a band the chain doesn’t carry.

Chirp-sweep phase (TDM)

Frequency-amplitude trace recovered from a logarithmic sweep. Where the curve drops to zero is the chain’s upper or lower limit.

Phase 4 — digital chain at infrasonic & ultrasonic frequencies

Bars: internal-tap peak amplitude at each test frequency. The signal never reaches the speakers (no acoustic loopback), so this only proves that the Web Audio engine can generate and analyze these tones at the chosen sample rate — not that they are audible. Useful for spotting Web Audio bugs that the acoustic phases hide behind speaker / mic roll-off. The ultrasonic bars depend entirely on the chosen sample rate (Nyquist = SR/2); the extended profile auto-uses 96 kHz when available.

Crossed output × input matrix — every reachable speaker against every reachable mic

Every output the browser will let us route to (supported on Chrome desktop at present) is paired with every input the OS will enumerate. Each cell plays a brief 1 kHz tone and records the mic-side peak. On iOS Safari the OS pre-mixes the iPad’s 4 corner speakers into one virtual output and beam-forms the 5-mic array into one virtual input, so the matrix collapses to 1×1 or 1×N — a constraint, not a bug. On desktop Chrome with USB / external interfaces the matrix exposes the full M×N routing.

Per-mic stereo probe — pan sweep, once per available mic

Even when one mic channel comes back silent because the OS upmixed mono → stereo (Phase 3 above), individual physical mics can still be addressed by deviceId. This phase iterates every audioinput device the OS exposes, opens it on its own stream, and runs the same pan sweep through it. Each row is one mic; the curve shows that mic’s amplitude vs. pan position. Useful for finding out which iPad / Mac mic is front-facing, which is bottom-facing, and how each one localises the soundstage.

Stereo phase — pan sweep across the speakers

A 1 kHz tone is panned from full-left to full-right over 4 s while the mic capture is split per channel. Left-mic amplitude should peak near pan = −1; right-mic near pan = +1. Both peaking together ⇒ mono mic; reversed order ⇒ L/R swap; one flat ⇒ that mic dead or muted.

Click or tap Run test to start. Microphone permission is requested the first time.

Interpreting failures

Symptom Likely cause Try
Generated panel silent Audio context blocked / muted Check silent-ringer switch (iPad/iPhone); unmute browser tab; tap anywhere
Mic panel silent, generated shows peak Mic permission denied or no mic Re-grant permission in browser settings; check OS input device
Both show signal but peaks don’t match Heavy room noise, or extreme EQ on the output chain Run in a quiet room; reduce headphone EQ; raise output volume
Mic peak at much higher freq than tone Bluetooth codec aliasing / sample-rate mismatch Switch to wired output or built-in speakers