Skip to content

generate-audio-tests

Generates a battery of WAV test files covering all combinations of signal type, channel count, sample rate, and bit depth. Each file is accompanied by a JSON sidecar with signal metadata, and a manifest.json index is written at the end.

generate-audio-tests [OPTIONS]
FlagDefaultDescription
--out-dirdata_generated/test-audioOutput directory
--channels1,2,6,16Channel counts (comma-separated; mono, stereo, 5.1, 9.1.6)
--sample-rates44100,48000,96000Sample rates in Hz (comma-separated)
--bits16,24Bit depths (16 or 24 only)
--signals(all)Signal types to generate (comma-separated; see below)
--duration10.0Duration in seconds (does not apply to sweep, which is fixed at 30 s)
ValueDescription
idPer-channel identification tones — each channel gets a unique frequency (300, 600, … 6000 Hz). Useful to verify channel routing.
thd1kSingle 1 kHz sine at −3 dBFS. Standard signal for Total Harmonic Distortion measurement.
thd100Single 100 Hz sine at −3 dBFS. Low-frequency THD measurement.
imd_smpteSMPTE IMD test: 60 Hz + 7 kHz at 4:1 amplitude ratio.
imd_ccifCCIF IMD test: 19 kHz + 20 kHz at equal amplitudes.
sweepLogarithmic frequency sweep 20 Hz → 20 kHz, 30 s fixed duration. Use for impulse response and frequency response measurements.
white_noiseWhite noise (flat spectrum).
pink_noisePink noise (1/f spectrum, −3 dB/octave).
m_noiseM-weighted noise per ITU-R 468. Standard for acoustic measurement.
data_generated/test-audio/
wav/
id/
id_ch1_sr44100_b16.wav
id_ch1_sr44100_b16.wav.json ← sidecar with signal metadata
id_ch2_sr48000_b24.wav
sweep/
sweep_ch2_sr96000_b24.wav
pink_noise/
manifest.json ← index of all generated files

Files that would violate Nyquist (e.g., a 20 kHz sweep at 22050 Hz sample rate) are skipped automatically and counted in the summary.

Generate everything (default):

Terminal window
generate-audio-tests

Stereo only, 48 kHz, 24-bit, sweep + pink noise:

Terminal window
generate-audio-tests \
--channels 2 \
--sample-rates 48000 \
--bits 24 \
--signals sweep,pink_noise

Custom output directory and duration:

Terminal window
generate-audio-tests --out-dir /tmp/audio-tests --duration 5.0

Each WAV file has a companion .wav.json with structured metadata:

{
"format": "wav",
"channels": 2,
"sample_rate": 48000,
"bits": 24,
"duration": 10.0,
"signal": {
"type": "pink_noise",
"description": "1/f spectrum, -3dB/octave (pink noise)"
}
}
  • Engine regression tests — run the full plugin chain on known signals and compare output
  • Room measurement — use sweep files as the test signal when recording room impulse responses
  • Channel routing verification — use id tones to confirm each channel reaches the correct speaker
  • Codec/format testing — spot-check encoder/decoder fidelity across sample rates and bit depths