wavtestgen is a small Python library and CLI for generating WAV test files from
JSON configs.
- Configurable sample rate and bit depth (
16/24/32-bit integer PCM) - Segment-based timelines:
sweep(linear or log)noise(white, pink, brown)silenceimpulses(single-sample spikes at explicit or auto-generated spacing)
- Peak-referenced dBFS levels
- Optional deterministic noise with
seed - Mono output or dual-mono stereo duplication
pip install -e .wavtestgen render /path/to/config.json /path/to/output.wavOptional overrides:
wavtestgen render config.json out.wav --sample-rate 48000 --bit-depth 24 --seed 123 --verboseTop-level fields:
sample_rate(required, int > 0)bit_depth(required:16,24,32)segments(required, non-empty list)channels(optional, default1, valid:1or2)seed(optional int)fade_ms(optional float, default1.0)min_sweep_freq_hz(optional float, default1.0)
Segment types:
sweep:duration_s,start_hz,end_hz,level_dbfs, optionalcurvenoise:duration_s,color, and either:level_dbfs(constant level), orstart_dbfs+end_dbfs(linear dB ramp across segment)
silence:duration_simpulses:duration_s, and either:times_s(explicit impulse times), orcountwith optionalwindow_start_s/window_end_sfor even spacing- Plus either
level_dbfs(constant level) orstart_dbfs+end_dbfs(impulse-by-impulse ramp), and optionalpolarity
See examples/example_config.json.
from wavtestgen import render_from_config, render_from_dict
render_from_config("config.json", "out.wav")
render_from_dict({...}, "out.wav")