Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wavtestgen

wavtestgen is a small Python library and CLI for generating WAV test files from JSON configs.

Features

  • Configurable sample rate and bit depth (16/24/32-bit integer PCM)
  • Segment-based timelines:
    • sweep (linear or log)
    • noise (white, pink, brown)
    • silence
    • impulses (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

Install

pip install -e .

CLI Usage

wavtestgen render /path/to/config.json /path/to/output.wav

Optional overrides:

wavtestgen render config.json out.wav --sample-rate 48000 --bit-depth 24 --seed 123 --verbose

Config Format

Top-level fields:

  • sample_rate (required, int > 0)
  • bit_depth (required: 16, 24, 32)
  • segments (required, non-empty list)
  • channels (optional, default 1, valid: 1 or 2)
  • seed (optional int)
  • fade_ms (optional float, default 1.0)
  • min_sweep_freq_hz (optional float, default 1.0)

Segment types:

  • sweep: duration_s, start_hz, end_hz, level_dbfs, optional curve
  • noise: duration_s, color, and either:
    • level_dbfs (constant level), or
    • start_dbfs + end_dbfs (linear dB ramp across segment)
  • silence: duration_s
  • impulses: duration_s, and either:
    • times_s (explicit impulse times), or
    • count with optional window_start_s/window_end_s for even spacing
    • Plus either level_dbfs (constant level) or start_dbfs + end_dbfs (impulse-by-impulse ramp), and optional polarity

Example

See examples/example_config.json.

Python API

from wavtestgen import render_from_config, render_from_dict

render_from_config("config.json", "out.wav")
render_from_dict({...}, "out.wav")

About

Generate a wav file of test signals of various types

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages