wavgen
A free command-line tool for generating synthetic WAV test signals — tones, sweeps, amplitude staircases, and silence — for audio-codec QA and audio post-processing testing.
Overview
wavgen produces the reference/input WAV files used to test audio codecs and audio post-processing algorithms (equalizers, virtualizers, dynamics processors, and similar signal chains). It generates precise, repeatable synthetic signals — pure tones, multi-tone stacks, frequency sweeps, amplitude staircases, broadband noise, and band-limited non-sinusoidal waveforms — at a specified sample rate, bit depth, and duration, optionally riding on a DC offset (see DC offset), and can optionally wrap that content with a sync tone (see Sync tone wrapping) to produce a complete, ready-to-run test file in one step.
It writes standard, uncompressed PCM WAV files. It does not analyze, compare, or score audio — for that, see the main wavelens analysis tool.
Requirements
- Nothing to install and no license needed (see Get it)
- Output sample rate between 22,050 Hz and 192,000 Hz (inclusive)
- Output bit depth of 16-bit, 24-bit or 32-bit integer PCM
Get it
wavgen is free. Download the zip from the free tools releases page and unzip it. It holds a folder for each system — windows, macos and linux — and each has wavgen (wavgen.exe on Windows) and its companion tool. There is nothing to install and no license to set up. Open a terminal in the folder for your system and run it.
The examples in this guide write wavgen on its own. On macOS and Linux write ./wavgen; in PowerShell, .\wavgen.
The README covers checking your download and what to expect the first time you run the tools on each system.
About --license
The usage text (wavgen --help) lists a --license option, because the licensed edition of the tool has one. This free build needs no license and ignores the option, and the WAVELENS_LICENSE_FILE environment variable, so a command written for the licensed edition runs unchanged.
Quick start
Generate a 5-second, 1kHz calibration tone at −20dBFS, 48kHz, 24-bit:
wavgen --mode tone --tone 1000:-20 \ --samplerate 48000 --bitdepth 24 --duration 5 -o calibration_1khz.wav
# output:
wrote calibration_1khz.wav (48000 Hz, 24-bit, 1 ch, 5.000s, 240000 frames)
Command syntax
Every invocation follows the same general shape: an optional license path, a mode, that mode's own parameters, and a set of options shared by every mode.
wavgen [--license <file.lic>] --mode <mode> [mode-specific options] --samplerate <Hz> --bitdepth <16|24|32> --duration <seconds> [--channels <1|2>] [--synctone] [--invert] [--dc-offset <fraction>] [--fade-in <ms>] -o <output.wav>
Options can appear in any order. Every option takes exactly one value, except --synctone and --invert, which are standalone on/off switches. --license is bracketed above because it's optional, and this free build ignores it — see Get it.
Global options
These apply to every mode.
| Option | Required | Description |
|---|---|---|
| --license <file> | optional | Accepted and ignored. It is listed so a command written for the licensed edition runs unchanged. See Get it. |
| --mode <mode> | required | One of tone, linear-sweep, log-sweep, step-sweep, step-seq, silence, noise, square, sawtooth. |
| --samplerate <Hz> | required | Output sample rate. Must be between 22,050 and 192,000 Hz. |
| --bitdepth <16|24|32> | required | Output bit depth, in bits per sample. |
| --duration <sec> | required | Output length in seconds. Must be greater than 0. Fractional values are allowed (e.g. 2.5). |
| --channels <1|2> | optional | 1 (mono, default) or 2 (stereo). Stereo output duplicates the generated signal identically onto both channels — it does not generate independent left/right content. See Stereo output. |
| -o <file> | required | Output WAV file path. Any existing file at that path is overwritten. |
| --synctone | optional | No value. Wraps the generated content with a sync tone and silence guards. See Sync tone wrapping. |
| --invert | optional | No value. Flips the sign of every generated sample (phase inversion), before --dc-offset and before any --synctone wrapping. Works with any mode. See Phase inversion. |
| --dc-offset <fraction> | optional | Adds a constant DC bias to the generated content, after --invert and before any --synctone wrapping. Linear fraction of full scale in [-1.0, 1.0] (e.g. 0.1 = 10%FS) — not dBFS. Works with any mode. See DC offset. |
| --fade-in <ms> | optional | Ramps the content up from silence over this many milliseconds (raised cosine) instead of starting at full level. Applied to the content only, before --invert, --dc-offset and any --synctone wrapping. Works with any mode. See Fade-in. |
Generation modes
Nine modes are available. Each is described below with its own required options and a worked example.
--mode tonesingle tone, or multiple simultaneous tones summed togetherGenerates one or more sine tones and sums them into a single signal. Pass --tone once per tone.
| Option | Description |
|---|---|
| --tone FREQ:AMPDB[:inv] | Adds one tone. FREQ in Hz, AMPDB in dBFS. Append :inv to invert the tone's polarity. Repeatable — pass multiple --tone options for multi-tone content. |
Single tone example — 1kHz at −6dBFS:
wavgen --mode tone --tone 1000:-6 \ --samplerate 48000 --bitdepth 24 --duration 10 -o tone_1k.wav
Multi-tone example — three simultaneous tones for a spectral-response test:
wavgen --mode tone \ --tone 500:-12 --tone 2000:-12 --tone 8000:-18 \ --samplerate 48000 --bitdepth 24 --duration 10 -o multitone.wav
If the combined peak of a multi-tone stack could exceed 0dBFS, wavgen prints a warning but still writes the file. Check the output for clipping and lower individual tone amplitudes if needed.
--mode linear-sweepfrequency sweep, constant Hz/secondSweeps from a start frequency/amplitude to an end frequency/amplitude at a constant rate of change in Hz. The sweep is phase-continuous and click-free throughout.
| Option | Description |
|---|---|
| --start FREQ:AMPDB | Starting frequency (Hz) and amplitude (dBFS). |
| --end FREQ:AMPDB | Ending frequency (Hz) and amplitude (dBFS). |
Example — full-range linear sweep, 20Hz to 20kHz over 5 seconds:
wavgen --mode linear-sweep \ --start 20:-6 --end 20000:-6 \ --samplerate 48000 --bitdepth 24 --duration 5 -o sweep_linear.wav
--mode log-sweepfrequency sweep, constant octaves/second (logarithmic)Same shape as linear-sweep, but the frequency progresses exponentially rather than linearly — it spends proportionally more time in lower frequencies, matching how frequency response is usually plotted and measured. Both start and end frequency must be greater than 0Hz.
| Option | Description |
|---|---|
| --start FREQ:AMPDB | Starting frequency (Hz, > 0) and amplitude (dBFS). |
| --end FREQ:AMPDB | Ending frequency (Hz, > 0) and amplitude (dBFS). |
Example — full-range log sweep, 20Hz to 20kHz over 5 seconds:
wavgen --mode log-sweep \ --start 20:-6 --end 20000:-6 \ --samplerate 48000 --bitdepth 24 --duration 5 -o sweep_log.wav
--mode step-sweepone fixed frequency, amplitude stepped through discrete levelsHolds a single frequency for the whole file, but steps its amplitude down (or up) by a fixed dB amount at a fixed time interval — a staircase, not a smooth ramp. Useful for amplitude-linearity testing.
| Option | Description |
|---|---|
| --freq HZ | The fixed tone frequency. |
| --start-amp AMPDB | Starting amplitude, in dBFS. |
| --step STEPDB | Amount to change the amplitude by at each step, in dB. Use a negative value to step down. |
| --step-duration SEC | How long each step is held before moving to the next. |
Example — 1kHz tone starting at 0dBFS, stepping down 6dB every second, for 5 steps:
wavgen --mode step-sweep \ --freq 1000 --start-amp 0 --step -6 --step-duration 1 \ --samplerate 48000 --bitdepth 24 --duration 5 -o amplitude_steps.wav
This produces five 1-second segments at 0, −6, −12, −18, and −24 dBFS.
--mode step-seqone fixed frequency, amplitude jumping between arbitrary segmentsLike step-sweep, but not constrained to a uniform step size or step duration — each segment is an independent AMPDB:DURATION pair, and the amplitude jumps instantly (not ramped) between them. Phase stays continuous across the whole file, so only the level changes at each boundary. This is the mode to reach for when you need a sudden, single level change — e.g. measuring a compressor's attack or release time — rather than a repeating staircase.
| Option | Description |
|---|---|
| --freq HZ | The fixed tone frequency. |
| --segment AMPDB:DURSEC | One segment: amplitude in dBFS, then duration in seconds. Repeat for each segment, in order. |
There is no --duration option for this mode — the file's total length is the sum of the segment durations, so it always matches what you asked for.
Example — a compressor attack-time probe: 0.5s at −40dBFS (below threshold), then an instant jump to 1.0s at 0dBFS (well above it):
wavgen --mode step-seq --freq 1000 \ --segment -40:0.5 --segment 0:1.0 \ --samplerate 48000 --bitdepth 24 --channels 2 -o attack_burst.wav
--mode silencedigital silenceGenerates a file of pure digital zero. Takes no mode-specific options — only the global ones:
wavgen --mode silence \ --samplerate 48000 --bitdepth 16 --duration 2 -o silence.wav
--mode noisebroadband noise, white or pinkGenerates white (flat-spectrum) or pink (1/f, roughly −3dB/octave) broadband noise. Level is specified in RMS dBFS, not peak — the standard convention for describing noise level, and the same convention Audio Precision's own generator uses for non-sine waveforms, since noise has no fixed peak-to-RMS ratio the way a tone does. White noise uses a Gaussian (not uniform) distribution for a realistic crest factor; pink noise is white noise passed through a standard 1/f filter.
| Option | Description |
|---|---|
| --color white|pink | Noise color. |
| --level RMSDBFS | Target level in RMS dBFS. Not peak — see above. |
| --seed N | Optional, defaults to 1. Same seed and parameters always produce byte-identical output — useful for a stable, repeatable test fixture rather than a fresh random file every run. |
Example — pink noise at −20dBFS RMS, a typical noise-floor calibration level:
wavgen --mode noise --color pink --level -20 --seed 42 \ --samplerate 48000 --bitdepth 24 --duration 10 -o pink_noise.wav
White noise's higher crest factor (peak well above its RMS level) is expected and correct — it's a property of Gaussian-distributed noise, not a bug. Don't compare its peak against a tone's peak-dBFS convention; compare RMS to RMS.
--mode squareband-limited square wave (odd harmonics only)Generates a square wave via additive harmonic synthesis, summing only the harmonics that fit below Nyquist — not a naive sign(sin(...)) generator, which would alias at any real sample rate. This matters specifically because square/sawtooth content exists to stress-test a device's aliasing and anti-aliasing behavior; a self-aliasing generator would make that test ambiguous. Odd harmonics only (1st, 3rd, 5th, ...), each at 1/k amplitude of the fundamental.
| Option | Description |
|---|---|
| --freq HZ | Fundamental frequency. |
| --amp AMPDB | Target peak level in dBFS — same convention as tone, unlike noise's RMS convention above. |
Example — 1kHz band-limited square wave at −6dBFS peak:
wavgen --mode square --freq 1000 --amp -6 \ --samplerate 48000 --bitdepth 24 --duration 5 -o square_1khz.wav
--mode sawtoothband-limited sawtooth wave (all harmonics)Same band-limited additive-synthesis approach as square, but with every harmonic (odd and even), each at 1/k amplitude — the richest harmonic content of any mode wavgen offers, and the strongest available aliasing/high-frequency-response stress test.
| Option | Description |
|---|---|
| --freq HZ | Fundamental frequency. |
| --amp AMPDB | Target peak level in dBFS. |
Example — 1kHz band-limited sawtooth wave at −6dBFS peak:
wavgen --mode sawtooth --freq 1000 --amp -6 \ --samplerate 48000 --bitdepth 24 --duration 5 -o sawtooth_1khz.wav
Stereo output
Every mode above defaults to mono. Pass --channels 2 to get a stereo file instead — the generated signal is duplicated identically onto both the left and right channels (dual-mono), not two independently-generated channels.
Works with any mode — tones, both sweep types, step-sweep, and silence:
# same dual-tone as the multi-tone example, now in stereo wavgen --mode tone \ --tone 500:-12 --tone 2000:-12 --channels 2 \ --samplerate 48000 --bitdepth 24 --duration 5 -o dual_tone_stereo.wav
# output:
wrote dual_tone_stereo.wav (48000 Hz, 24-bit, 2 ch, 5.000s, 240000 frames)
If you need genuinely independent left/right content (a different signal per channel, not a duplicate), that's not something wavgen does in one step — generate two separate mono files and combine them with wavchan pack. See the FAQ below. If the two channels only need to be phase-inverted copies of each other (a standard out-of-phase stereo test), see Phase inversion — one flag, no need for a third-party tool.
Phase inversion
Pass --invert alongside any mode to flip the sign of every generated sample — a standard technique for testing phase-cancellation, mid/side processing, and multiband crossover artifacts. It's boolean, no value needed, and works with every mode (tones, both sweep types, step-sweep, step-seq, noise, square, sawtooth).
Since --channels 2 duplicates one signal onto both channels (see Stereo output above), --invert can't give you a plain left channel and an inverted right channel in a single call — --channels 2 --invert inverts both channels identically. To build a genuine out-of-phase stereo pair, generate the same content twice (mono), inverting only the second call, then combine with wavchan pack:
# a 20Hz-20kHz sweep, in-phase on L and phase-inverted on R wavgen --mode log-sweep --start 20:0 --end 20000:0 \ --samplerate 48000 --bitdepth 24 --duration 30 -o left.wav wavgen --mode log-sweep --start 20:0 --end 20000:0 \ --samplerate 48000 --bitdepth 24 --duration 30 --invert -o right.wav wavchan pack --segment L:left.wav --segment R:right.wav -o out_of_phase_sweep.wav
--invert is not the same as a per-tone --tone FREQ:AMPDB:inv — that flips one tone relative to the others within a single --mode tone call (see tone), useful for cancellation testing inside one channel's own spectrum. --invert flips the entire generated file, any mode, and the two flags aren't mutually exclusive — you can pass both in the same call if you need both effects at once.
--invert always runs before --dc-offset, so a DC bias you specify keeps its literal sign regardless of whether --invert is also present.
DC offset
Pass --dc-offset <fraction> alongside any mode to add a constant DC bias to the generated content — useful for testing DC-blocking/leakage behavior in filters, compressors, and other non-linear post-processing chains. It's a linear fraction of full scale in [-1.0, 1.0] (e.g. 0.1 = 10%FS), not dBFS — a fixed, non-oscillating offset doesn't fit dB's ratio framing the way every mode's own amplitude does.
Combine it with --mode silence for a pure DC stimulus, or with any other mode for "a signal riding on a bias":
# pure DC at 10% of full scale wavgen --mode silence --dc-offset 0.1 \ --samplerate 48000 --bitdepth 24 --duration 5 -o dc_pure.wav # a 1kHz tone riding on the same 10%FS DC bias wavgen --mode tone --tone 1000:-20 --dc-offset 0.1 \ --samplerate 48000 --bitdepth 24 --duration 5 -o dc_tone.wav
The offset applies to your content only — it never shifts a --synctone burst or its silence guards, so sync-tone detection on the resulting file isn't affected by whatever --dc-offset you chose.
Fade-in
By default every signal starts at full level on its very first sample. Every lossy codec (AAC, MP3, Opus) has a start-up transient in its first ~40 ms: the decoded start differs from the source by far more than the rest of the file. A loud sweep that begins abruptly puts all of that error into the first analysis frame, and a comparison of a transparent codec can fail on it. Pass --fade-in <ms> to ramp the content up from silence (raised cosine) over that many milliseconds instead. 50 ms is enough for a codec test.
wavgen --mode log-sweep --start 20:-6 --end 20000:-6 --samplerate 48000 --bitdepth 24 --duration 10 --fade-in 50 -o sweep_for_codec.wav
The fade applies to the generated content only — never to --synctone guards and bursts — and runs before --invert and --dc-offset, so a DC bias you ask for is not faded in. It works with any mode, the file length does not change, and a fade longer than the content is an error. Without the flag the output is exactly what it would have been. The WaveLens analysis tool also leaves about the first and last 85 ms out of a sweep's whole-file Spectral Fidelity scan, so the start-up and tail of a codec are not part of what that check judges; the fade-in keeps the start of the signal itself gentle as well.
Sync tone wrapping
Every generation mode above produces bare content by default. Pass --synctone to additionally wrap that content with a sync tone and silence guards on both sides — the structure a full Audio QA test file needs so it can be located and trimmed automatically later.
With --synctone, the output file becomes:
[1.0s silence] [leading tone] [1.0s silence] [your content] [1.0s silence] [trailing tone] [1.0s silence]
The sync tone itself is a short, distinctive swept "boing" — four brief frequency sweeps in a row, each covering a slightly different range, separated by tiny silences. It's designed to be easy to detect reliably and to survive typical audio processing without needing you to configure anything.
Usage
--synctone takes no value — just add it to any command. Everything else about the command (mode, samplerate, bitdepth, duration, channels) works exactly the same; --duration still refers to the length of your content, not the total file length (which will be longer once the sync tone and silence are added).
# same 1kHz tone as the Quick Start example, now sync-tone wrapped wavgen --mode tone --tone 1000:-20 --synctone \ --samplerate 48000 --bitdepth 24 --duration 5 -o calibration_1khz_synctone.wav
# output — note the total length (10.5s) is longer than the 5s of requested content:
wrote calibration_1khz_synctone.wav (48000 Hz, 24-bit, 1 ch, 10.500s, 504000 frames, sync-tone wrapped)
The sync tone's own parameters (frequency ranges, repeat count, amplitude, guard length) use fixed defaults and aren't adjustable from the command line — --synctone is an on/off switch, not a configuration surface.
Output format
- Standard, uncompressed PCM WAV (RIFF/WAVE), 16-bit, 24-bit or 32-bit signed integer samples
- Sample rate: any value from 22,050 Hz to 192,000 Hz
- Mono (1 channel) or stereo (2 channels, dual-mono duplicated)
- Amplitudes are specified in dBFS (decibels relative to full scale) and converted internally; a tone at
0dBFS reaches exactly full scale
Common recipes
Calibration reference tone
A standard −20dBFS 1kHz tone, commonly used as a level reference:
wavgen --mode tone --tone 1000:-20 \ --samplerate 48000 --bitdepth 24 --duration 10 -o ref_1khz_-20dbfs.wav
Frequency response measurement stimulus
A log sweep is the standard stimulus for measuring how a codec or post-processing algorithm affects frequency response across the audible range:
wavgen --mode log-sweep \ --start 20:-12 --end 20000:-12 \ --samplerate 48000 --bitdepth 24 --duration 10 -o freq_response_stimulus.wav
Multi-tone spectral test content
A stack of tones spanning the audible range, useful for checking multiple frequency bands in a single pass:
wavgen --mode tone \ --tone 100:-14 --tone 500:-12 --tone 1000:-10 \ --tone 4000:-13 --tone 10000:-16 \ --samplerate 48000 --bitdepth 24 --duration 15 -o spectral_test.wav
Amplitude-linearity staircase
Steps a tone down through a wide dynamic range to check how consistently level is preserved at each step:
wavgen --mode step-sweep \ --freq 1000 --start-amp 0 --step -10 --step-duration 2 \ --samplerate 48000 --bitdepth 24 --duration 20 -o linearity_steps.wav
Full example reference
Every distinct command variation wavgen supports, grouped by mode — for whenever you want to see the full range in one place rather than hunting through the sections above.
Tone — single tone
# baseline: 1kHz at -6dBFS, mono, 48kHz/24-bit wavgen --mode tone --tone 1000:-6 --samplerate 48000 --bitdepth 24 --duration 5 -o tone_1khz.wav # standard -20dBFS 1kHz calibration/reference tone wavgen --mode tone --tone 1000:-20 --samplerate 48000 --bitdepth 24 --duration 10 -o tone_calibration.wav # low-frequency tone (40Hz) -- probes bass/rumble handling wavgen --mode tone --tone 40:-12 --samplerate 48000 --bitdepth 24 --duration 5 -o tone_40hz_low.wav # high-frequency tone (18kHz) -- probes near-Nyquist handling at 48kHz wavgen --mode tone --tone 18000:-12 --samplerate 48000 --bitdepth 24 --duration 5 -o tone_18khz_high.wav # polarity inverted (":inv" suffix) -- for phase/polarity-sensitive DUT testing wavgen --mode tone --tone 1000:-6:inv --samplerate 48000 --bitdepth 24 --duration 5 -o tone_inverted.wav # 16-bit instead of 24-bit wavgen --mode tone --tone 1000:-6 --samplerate 48000 --bitdepth 16 --duration 5 -o tone_16bit.wav # minimum supported sample rate (22,050 Hz) wavgen --mode tone --tone 1000:-6 --samplerate 22050 --bitdepth 24 --duration 5 -o tone_22khz_min.wav # maximum supported sample rate (192,000 Hz) wavgen --mode tone --tone 1000:-6 --samplerate 192000 --bitdepth 24 --duration 5 -o tone_192khz_max.wav # stereo (dual-mono) wavgen --mode tone --tone 1000:-6 --samplerate 48000 --bitdepth 24 --duration 5 --channels 2 -o tone_stereo.wav
Tone — multi-tone
# dual-tone wavgen --mode tone --tone 500:-12 --tone 2000:-12 --samplerate 48000 --bitdepth 24 --duration 10 -o multitone_dual.wav # three-tone stack wavgen --mode tone --tone 500:-12 --tone 2000:-12 --tone 8000:-18 --samplerate 48000 --bitdepth 24 --duration 10 -o multitone_3tone.wav # four-tone stack wavgen --mode tone --tone 200:-12 --tone 1000:-12 --tone 5000:-12 --tone 12000:-16 --samplerate 48000 --bitdepth 24 --duration 10 -o multitone_quad.wav # twelve-tone wide-band stack (30Hz to 16kHz), -22dBFS each wavgen --mode tone --tone 30:-22 --tone 200:-22 --tone 325:-22 --tone 500:-22 --tone 700:-22 --tone 1000:-22 --tone 1400:-22 --tone 2000:-22 --tone 2800:-22 --tone 4000:-22 --tone 8000:-22 --tone 16000:-22 --samplerate 48000 --bitdepth 24 --duration 15 -o multitone_12tone.wav # fourteen-tone wide-band stack (22Hz to 20kHz), -23dBFS each wavgen --mode tone --tone 22:-23 --tone 30:-23 --tone 42:-23 --tone 52:-23 --tone 70:-23 --tone 80:-23 --tone 135:-23 --tone 155:-23 --tone 460:-23 --tone 910:-23 --tone 1740:-23 --tone 3410:-23 --tone 10265:-23 --tone 20000:-23 --samplerate 48000 --bitdepth 24 --duration 15 -o multitone_14tone.wav # deliberately near-0dBFS -- triggers the clip-safety warning, still writes the file wavgen --mode tone --tone 1000:-1 --tone 2000:-1 --samplerate 48000 --bitdepth 16 --duration 5 -o multitone_clip_warning_demo.wav # dual-tone, stereo wavgen --mode tone --tone 500:-12 --tone 2000:-12 --samplerate 48000 --bitdepth 24 --duration 5 --channels 2 -o multitone_dual_stereo.wav
Linear sweep
# full-range, 20Hz to 20kHz, -6dBFS wavgen --mode linear-sweep --start 20:-6 --end 20000:-6 --samplerate 48000 --bitdepth 24 --duration 5 -o linsweep_up.wav # reverse direction: 20kHz down to 20Hz wavgen --mode linear-sweep --start 20000:-6 --end 20:-6 --samplerate 48000 --bitdepth 24 --duration 5 -o linsweep_down.wav # amplitude fade-in: quiet at the start, full level by the end wavgen --mode linear-sweep --start 20:-30 --end 20000:-6 --samplerate 48000 --bitdepth 24 --duration 5 -o linsweep_fade_in.wav # narrow-band (500Hz-2000Hz) -- a band-limited stimulus for a specific filter/EQ band wavgen --mode linear-sweep --start 500:-6 --end 2000:-6 --samplerate 48000 --bitdepth 24 --duration 3 -o linsweep_narrowband.wav # 16-bit / 44100Hz wavgen --mode linear-sweep --start 20:-6 --end 20000:-6 --samplerate 44100 --bitdepth 16 --duration 5 -o linsweep_44100hz_16bit.wav # stereo wavgen --mode linear-sweep --start 20:-6 --end 20000:-6 --samplerate 48000 --bitdepth 24 --duration 5 --channels 2 -o linsweep_stereo.wav
Log sweep
# full-range, 20Hz to 20kHz -- the standard frequency-response measurement stimulus wavgen --mode log-sweep --start 20:-6 --end 20000:-6 --samplerate 48000 --bitdepth 24 --duration 5 -o logsweep_up.wav # reverse direction: 20kHz down to 20Hz wavgen --mode log-sweep --start 20000:-6 --end 20:-6 --samplerate 48000 --bitdepth 24 --duration 5 -o logsweep_down.wav # amplitude fade-out: full level at the start, quiet by the end wavgen --mode log-sweep --start 20:-6 --end 20000:-30 --samplerate 48000 --bitdepth 24 --duration 5 -o logsweep_fade_out.wav # narrow-band (100Hz-4000Hz) wavgen --mode log-sweep --start 100:-6 --end 4000:-6 --samplerate 48000 --bitdepth 24 --duration 3 -o logsweep_narrowband.wav # minimum sample rate boundary (22,050 Hz) wavgen --mode log-sweep --start 20:-6 --end 15000:-6 --samplerate 22050 --bitdepth 24 --duration 5 -o logsweep_22khz_min.wav # stereo wavgen --mode log-sweep --start 20:-6 --end 20000:-6 --samplerate 48000 --bitdepth 24 --duration 5 --channels 2 -o logsweep_stereo.wav
Step-sweep
# 1kHz, 0dBFS stepping DOWN 6dB every second, 10 steps wavgen --mode step-sweep --freq 1000 --start-amp 0 --step -6 --step-duration 1 --samplerate 48000 --bitdepth 24 --duration 10 -o stepsweep_down.wav # same idea, stepping UP instead (positive --step) wavgen --mode step-sweep --freq 1000 --start-amp -30 --step 6 --step-duration 1 --samplerate 48000 --bitdepth 24 --duration 10 -o stepsweep_up.wav # different frequency, larger step, longer hold -- a coarser linearity sweep at 4kHz wavgen --mode step-sweep --freq 4000 --start-amp 0 --step -10 --step-duration 2 --samplerate 48000 --bitdepth 24 --duration 20 -o stepsweep_4khz_coarse.wav # 16-bit instead of 24-bit wavgen --mode step-sweep --freq 1000 --start-amp 0 --step -6 --step-duration 1 --samplerate 48000 --bitdepth 16 --duration 10 -o stepsweep_16bit.wav # stereo wavgen --mode step-sweep --freq 1000 --start-amp 0 --step -6 --step-duration 1 --samplerate 48000 --bitdepth 24 --duration 10 --channels 2 -o stepsweep_stereo.wav
Step sequence
# compressor attack probe: -40dBFS for 0.5s, then instant jump to 0dBFS for 1.0s wavgen --mode step-seq --freq 1000 --segment -40:0.5 --segment 0:1.0 --samplerate 48000 --bitdepth 24 --channels 2 -o attack_burst.wav # compressor release probe: 0dBFS for 1.0s, then instant drop to -40dBFS for 0.5s wavgen --mode step-seq --freq 1000 --segment 0:1.0 --segment -40:0.5 --samplerate 48000 --bitdepth 24 --channels 2 -o release_burst.wav # three-segment sequence -- e.g. quiet, loud, quiet again wavgen --mode step-seq --freq 1000 --segment -30:0.5 --segment 0:0.5 --segment -30:0.5 --samplerate 48000 --bitdepth 24 -o three_segment.wav # note: no --duration -- total length is the sum of the --segment durations
Silence
# short mono silence -- typical guard/padding duration wavgen --mode silence --samplerate 48000 --bitdepth 24 --duration 1 -o silence_mono.wav # stereo wavgen --mode silence --samplerate 48000 --bitdepth 24 --duration 1 --channels 2 -o silence_stereo.wav # longer, at 16-bit wavgen --mode silence --samplerate 48000 --bitdepth 16 --duration 5 -o silence_16bit.wav # minimum sample rate boundary wavgen --mode silence --samplerate 22050 --bitdepth 24 --duration 1 -o silence_22khz_min.wav # maximum sample rate boundary wavgen --mode silence --samplerate 192000 --bitdepth 24 --duration 1 -o silence_192khz_max.wav
Noise
# white noise, -20dBFS RMS -- a typical general-purpose level wavgen --mode noise --color white --level -20 --seed 1 --samplerate 48000 --bitdepth 24 --duration 10 -o noise_white.wav # pink noise, -20dBFS RMS -- the standard frequency-response/EQ measurement stimulus wavgen --mode noise --color pink --level -20 --seed 1 --samplerate 48000 --bitdepth 24 --duration 10 -o noise_pink.wav # quiet pink noise -- noise-floor calibration content wavgen --mode noise --color pink --level -60 --seed 1 --samplerate 48000 --bitdepth 24 --duration 5 -o noise_pink_floor.wav # explicit seed for a reproducible fixture -- same seed always reproduces the same file wavgen --mode noise --color white --level -20 --seed 12345 --samplerate 48000 --bitdepth 24 --duration 5 -o noise_white_seeded.wav # stereo wavgen --mode noise --color pink --level -20 --seed 1 --samplerate 48000 --bitdepth 24 --duration 10 --channels 2 -o noise_pink_stereo.wav
Square
# 1kHz, -6dBFS peak -- odd-harmonics-only aliasing/transient stress test wavgen --mode square --freq 1000 --amp -6 --samplerate 48000 --bitdepth 24 --duration 5 -o square_1khz.wav # lower frequency -- more harmonics fit below Nyquist, richer content wavgen --mode square --freq 200 --amp -6 --samplerate 48000 --bitdepth 24 --duration 5 -o square_200hz.wav # stereo wavgen --mode square --freq 1000 --amp -6 --samplerate 48000 --bitdepth 24 --duration 5 --channels 2 -o square_1khz_stereo.wav
Sawtooth
# 1kHz, -6dBFS peak -- richest available harmonic content (odd + even) wavgen --mode sawtooth --freq 1000 --amp -6 --samplerate 48000 --bitdepth 24 --duration 5 -o sawtooth_1khz.wav # lower frequency -- more harmonics fit below Nyquist wavgen --mode sawtooth --freq 200 --amp -6 --samplerate 48000 --bitdepth 24 --duration 5 -o sawtooth_200hz.wav # stereo wavgen --mode sawtooth --freq 1000 --amp -6 --samplerate 48000 --bitdepth 24 --duration 5 --channels 2 -o sawtooth_1khz_stereo.wav
DC offset combined with each mode
# pure DC at 10%FS -- for DC-blocking/leakage testing wavgen --mode silence --dc-offset 0.1 --samplerate 48000 --bitdepth 24 --duration 5 -o dc_pure.wav # tone riding on a DC bias wavgen --mode tone --tone 1000:-20 --dc-offset 0.1 --samplerate 48000 --bitdepth 24 --duration 5 -o dc_tone.wav # negative bias wavgen --mode silence --dc-offset -0.15 --samplerate 48000 --bitdepth 24 --duration 5 -o dc_negative.wav
Sync tone wrapping combined with each mode
# calibration tone, sync-tone wrapped -- 10.5s total (5s content + 5.5s of sync tones and silence) wavgen --mode tone --tone 1000:-6 --synctone --samplerate 48000 --bitdepth 24 --duration 5 -o synctone_tone.wav # log sweep, sync-tone wrapped -- a complete frequency-response measurement file wavgen --mode log-sweep --start 20:-6 --end 20000:-6 --synctone --samplerate 48000 --bitdepth 24 --duration 5 -o synctone_logsweep.wav # sync-tone wrapping + stereo together -- the whole wrapped file is duplicated onto both channels wavgen --mode tone --tone 1000:-6 --synctone --channels 2 --samplerate 48000 --bitdepth 24 --duration 5 -o synctone_tone_stereo.wav
Errors & troubleshooting
| Message | Meaning & fix |
|---|---|
| error: --samplerate must be in [22050, 192000] Hz | The requested sample rate is outside the supported range. Choose a value in range (e.g. 44100, 48000, 96000, 192000). |
| error: --bitdepth must be 16, 24 or 32 | Only 16-bit, 24-bit and 32-bit integer PCM output are supported. |
| error: --duration must be > 0 | Duration must be a positive number of seconds. |
| error: malformed --tone '...', expected FREQ:AMPDB[:inv] | Check the --tone value uses a colon between frequency and amplitude, e.g. 1000:-6. |
| error: --mode log-sweep requires start/end frequency > 0 | A log sweep can't start or end at 0Hz. Use linear-sweep if you need to sweep through 0Hz, or pick a small positive starting frequency. |
| error: --mode noise requires --color white|pink and --level RMSDBFS | Both are required for --mode noise — there's no default color or level. |
| error: --color must be 'white' or 'pink', got '...' | Only those two values are recognized. Check spelling. |
| error: --mode square|sawtooth requires --freq > 0 and --amp AMPDB | Both are required — there's no default frequency or amplitude. |
| error: --dc-offset must be in [-1.0, 1.0] (linear fraction of full scale), got ... | The value is out of range. Remember this is a linear fraction, not dBFS — 0.1 means 10%FS, not −0.1dB. |
FAQ
Do I need a license?
No. wavgen is free and has no license check. It accepts --license <file> and ignores it, so commands written for the licensed edition run unchanged.
Can I generate true stereo content with different signals on each channel?
Not with wavgen alone — --channels 2 only duplicates one signal onto both channels (dual-mono); every mode generates a single signal. Generate each channel's content as a separate mono wavgen call, then combine them with wavchan pack (see the wavchan user guide), e.g. wavchan pack --segment L:left.wav --segment R:right.wav -o stereo.wav. If the two channels only need to be phase-inverted copies of each other rather than fully independent content, add --invert to the second call instead of generating genuinely different content — see Phase inversion.
Can wavgen add noise, or simulate dropouts and clicks?
wavgen can generate broadband white/pink noise (--mode noise) as its own standalone content. It doesn't inject artifacts — dropouts, clicks, clips, or a known-precise difference between a reference and a DUT file — into existing content; that's outside what wavgen does — it generates clean test signals.
What sample formats can I feed into the WaveLens analysis tool afterward?
Anything wavgen writes — 16-, 24- or 32-bit PCM WAV, mono or stereo, 22,050–192,000 Hz — is valid input for wavelens. See the wavelens user guide for its full input requirements.