Skip to content

martin-hunt/audio_metrics

Repository files navigation

audio_metrics

A command-line tool to compare audio/media files side-by-side, showing file metadata and audio statistics (RMS, peak, crest factor, A-weighted levels).

I wrote this because I wanted a quick way to check the sample rate, bit depth, and other properties of audio files, and to optionally compare them side-by-side. It can be useful for checking the output of audio processing scripts, or comparing different versions of a file.

Running

Run directly from GitHub with uvx:

uvx --from git+https://github.com/martin-hunt/audio_metrics audio_metrics <input1> [input2] [input3] [--verbose]

Analyse a single file:

uv run python audio_metrics.py <input>

Compare two or three files:

uv run python audio_metrics.py <input1> <input2> [<input3>]

Show metadata tags (ID3, Vorbis comment, etc.):

uv run python audio_metrics.py <input1> <input2> --verbose

After uv sync the script is also available as an installed entry point:

uv run audio_metrics <input1> <input2>

Running the tests

uv run pytest

Or run tests with uvx (no prior setup needed):

uvx --from pytest --with . pytest

Example output

Single file

uv run python audio_metrics.py test/files/LDC93S1.wav

Example Output

Comparison (two files)

Differences between files are highlighted in yellow in the terminal.

uv run python audio_metrics.py test/files/sr006*

Comparison example with tags

Supported formats

Format Read Tags
WAV ✓ (if ID3 embedded)
FLAC ✓ (Vorbis comment)
OGG Vorbis ✓ (Vorbis comment)
OGG Opus ✓ (Vorbis comment)
MP3 ✓ (ID3)

About

Display a table of metrics for audio files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages