Developer testing guide

WAV testing for playback and waveforms

The local generator creates 44.1 kHz, 16-bit mono PCM WAV fixtures. Fixed seeds make white noise reproducible, while sine, square, and silence samples expose visibly different waveform behavior.

Verified . PCM samples, RIFF headers, waveform pixels, seeking, and generated Blob downloads are covered by browser tests.

Practical checklist

  • Read duration and sample format from the bytes.
  • Test sine, square, noise, and silence separately.
  • Verify user-initiated playback and seeking.
  • Record exact bytes when padding a boundary fixture.

Use known signals

Reference tones make amplitude, duration, waveform, and resampling defects easier to spot. Silence isolates noise floors and voice-activity thresholds; seeded white noise provides a repeatable broadband input.

Test browser policies

Browsers restrict audible autoplay. Test user-initiated playback, pause, keyboard seeking, preload behavior, and recovery after a decode error while keeping native controls available.

Separate content from padding

Exact-size fixtures may include trailing NULL bytes after a valid WAV payload. Treat the declared RIFF length and physical file size as separate observations when testing upload limits.

Expected results

  • Repeated seeded-noise generation produces identical bytes.
  • Silence renders a center line and tones produce distinct waveforms.
  • Generated WAV files retain a valid RIFF/WAVE signature after exact-size padding.

Common failure modes

  • Using non-deterministic noise in regression tests.
  • Assuming physical size equals declared PCM payload length.
  • Replacing accessible native controls with canvas-only playback.

Generate fixtures locally

This category uses browser-generated fixtures and does not publish permanent asset URLs.

Open the local generator

Format references

Copied