Structured audio comparison for producers and developers. Think git diff, but for audio.
Project description
sounddiff
sounddiff is a CLI tool for audio producers and developers to compare two audio files and see exactly what changed. It reports differences in loudness, spectral balance, timing, and potential issues like clipping and silence. Output comes as colored terminal text, structured JSON, or a self-contained HTML report.
New to audio? The sounddiff wiki has plain-language guides to LUFS, spectral analysis, clipping, and everything else sounddiff measures.
Example
$ sounddiff mix-v3.wav mix-v4.wav
sounddiff: mix-v3.wav vs mix-v4.wav
Duration 3:42.108 → 3:42.108 (no change)
Sample Rate 48000 Hz → 48000 Hz (no change)
Channels stereo → stereo (no change)
Loudness (integrated)
LUFS -14.2 → -12.8 (+1.4 dB)
Peak dBTP -1.1 → -0.3 (+0.8 dB)
LRA 8.2 → 6.4 (-1.8 LU)
Spectral
Low (20-250 Hz) +0.8 dB avg
Mid (250-4k Hz) +0.3 dB avg
High (4k-20k Hz) +1.9 dB avg
Segments
0:00-1:12 similar (correlation: 0.97)
1:12-1:14 ADDED (new content, 2.1s)
1:14-3:42 similar (correlation: 0.98, shifted +2.1s)
Issues
⚠ Clipping detected in mix-v4.wav at 2:31.4 (3 samples)
Installation
pipx install sounddiff
Or with pip: pip install sounddiff
Requires Python 3.10 or later. Supports WAV, FLAC, OGG, and AIFF natively. For MP3, AAC, WMA, and Opus, install ffmpeg. See docs/install.md for detailed setup.
Usage
Compare two files with colored terminal output:
sounddiff old-mix.wav new-mix.wav
Get structured JSON for scripts and CI pipelines:
sounddiff old.wav new.wav --format json
Generate an HTML report:
sounddiff old.wav new.wav --format html -o report.html
See docs/usage.md for all options.
What it analyzes
| Category | Measurements |
|---|---|
| Loudness | Integrated LUFS, true peak (dBTP), loudness range (LRA) per ITU-R BS.1770 |
| Spectral | Average energy per frequency band (low, mid, high) with configurable ranges |
| Temporal | Segment-level cross-correlation, added/removed/shifted section detection |
| Detection | Clipping events (timestamp, channel, sample count), silence regions |
| Metadata | Duration, sample rate, channels, bit depth, format |
Output formats
Terminal is the default. Colored, grouped by category, designed to be read top to bottom. Uses rich for formatting.
JSON outputs the same data in a structured format. Pipe it to jq, parse it in Python, or use it in CI pipelines for automated regression testing.
HTML generates a self-contained report with inline styles. No external dependencies. Open it in any browser, share it with your team, or archive it alongside your session files.
How it's built
sounddiff is written in Python with a modular architecture. Each analysis type (loudness, spectral, temporal, detection) lives in its own module with no cross-dependencies. The core orchestrator loads two audio files, runs all analyzers, and passes the results to a formatter.
| Dependency | Purpose |
|---|---|
| soundfile | Audio I/O via libsndfile |
| numpy | Array math, FFT, cross-correlation |
| scipy | Signal processing |
| pyloudnorm | ITU-R BS.1770 loudness measurement |
| click | CLI framework |
| rich | Terminal formatting |
| jinja2 | HTML report templates |
See docs/architecture.md for the full module breakdown and data flow.
Documentation
- Wiki - guides to LUFS, spectral analysis, clipping, and other audio concepts
- Installation - system dependencies, shell completions, ffmpeg setup
- Usage - CLI options and examples
- API Reference - using sounddiff as a Python library
- Architecture - module layout and design decisions
Contributing
Contributions are welcome. See CONTRIBUTING.md for setup instructions and our development workflow.
The issue board has open work organized by milestone. Issues labeled good first issue are scoped for newcomers and have enough context to get started without deep DSP knowledge.
Security
Report vulnerabilities to dev@systemblue.io. See SECURITY.md for our disclosure policy.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sounddiff-0.2.1.tar.gz.
File metadata
- Download URL: sounddiff-0.2.1.tar.gz
- Upload date:
- Size: 47.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa7e039cfa6637ae1b2de750a023f77dae767697cac28ad531007302c7c2c090
|
|
| MD5 |
51bb0e51ce541348359717d1b666a046
|
|
| BLAKE2b-256 |
c92b0ddff74c7cbf18c893bcd14b5617868add00946f60c1bfeec5cbb07c5631
|
Provenance
The following attestation bundles were made for sounddiff-0.2.1.tar.gz:
Publisher:
release.yml on systemblueteam/sounddiff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sounddiff-0.2.1.tar.gz -
Subject digest:
fa7e039cfa6637ae1b2de750a023f77dae767697cac28ad531007302c7c2c090 - Sigstore transparency entry: 1189457463
- Sigstore integration time:
-
Permalink:
systemblueteam/sounddiff@f571de7068eb41bda5a8321b59dcfe9e9dbb2be3 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/systemblueteam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f571de7068eb41bda5a8321b59dcfe9e9dbb2be3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sounddiff-0.2.1-py3-none-any.whl.
File metadata
- Download URL: sounddiff-0.2.1-py3-none-any.whl
- Upload date:
- Size: 23.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2cb1f937d7a37843c8bdc9687b4e71f2e2bd1dbe7d91eb98605b929944551cd
|
|
| MD5 |
b8c5df05c61369307164b73a709404a4
|
|
| BLAKE2b-256 |
b3203729a24b1e8dc26ce74171a7bf8820123dd1e824d8ca192488791217c92e
|
Provenance
The following attestation bundles were made for sounddiff-0.2.1-py3-none-any.whl:
Publisher:
release.yml on systemblueteam/sounddiff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sounddiff-0.2.1-py3-none-any.whl -
Subject digest:
f2cb1f937d7a37843c8bdc9687b4e71f2e2bd1dbe7d91eb98605b929944551cd - Sigstore transparency entry: 1189457466
- Sigstore integration time:
-
Permalink:
systemblueteam/sounddiff@f571de7068eb41bda5a8321b59dcfe9e9dbb2be3 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/systemblueteam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f571de7068eb41bda5a8321b59dcfe9e9dbb2be3 -
Trigger Event:
push
-
Statement type: