Skip to main content

Dynamic Range (DR) meter 🎧

Tests Coverage Status Docker

PyPI PyPI - Python Version PyPI - Downloads

Linter/Formatter: Ruff Code style: Black Dependency management: poetry

A Dynamic Range (DR) analyzer for audiofiles.

Asciicast of installing and using drmeter

The algorithm has been reverse-engineered using the available information and officially endorsed software to calcuate the DR value. The analysis results of drmeter are verified to be within a ±0.5 absolute tolerance from the results produced by officially endorsed software (see #testing).

This project is in no way affiliated with the Pleasurize Music Foundation or its Dynamic Range Project.

Installation

The recommended method for using drmeter is with uv and uvx specifically:

uvx drmeter --help

Any regular pip install drmeter will do, too.

There is also a container image available at codeberg.org/janw/drmeter:

docker run --rm --tty --workdir /src -v "$PWD:/src" \
    codeberg.org/janw/drmeter --output json path/to/files

Usage

See drmeter --help for usage instructions. drmeter expects a single path to a file or a directory to analyze, and defaults to an "animated" progress display, emitting the results to stdout in the process.

$ drmeter 'Nobody There (Beautiful Scars).wav'
Analyzing Dynamic Range of Nobody There (Beautiful Scars).wav ...

╭──────────────────────────────────────────────────────────────────────╮
│ DR            Peak          RMS   Filename                           │
├──────────────────────────────────────────────────────────────────────┤
│ DR12      -0.10 dB    -15.02 dB   Nobody There (Beautiful Scars).wav │
╰──────────────────────────────────────────────────────────────────────╯

Using the --quiet/-q flag will silence most of the output and only print the calculated DR score to stdout:

$ drmeter 'Nobody There (Beautiful Scars).wav' -q
DR12

Alternatively drmeter supports a more detailed JSON-formatted output using the --output/-o json parameter, including both per-channel and totaled results. Using the --output parameter redirects the progress display to stderr, so that the formatted output can be piped to other applications or to file. If you do not require the progress display, it can be silenced using --quiet/-q here, too.

# Save a copy to file
$ drmeter -ojson -q 'Nobody There (Beautiful Scars).wav' | tee dr.json
{
  "filename": "/…/Nobody There (Beautiful Scars).wav",
  "dr_score": [
    11.93,
    11.63
  ],
  "peak_db": [
    …
  ]
}
# Parse JSON using jq
$ drmeter -ojson -q 'Nobody There (Beautiful Scars).wav' | jq '.[].overall_dr_score'
11.78

Metadata

Release files for drmeter 0.4.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drmeter 0.4.9
File Size Uploaded
drmeter-0.4.9.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for drmeter 0.4.9
File Interpreter ABI Platform
drmeter-0.4.9-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / drmeter-0.4.9.tar.gz

Download URL drmeter-0.4.9.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
043f67f8bd3e970516e771f4f79e99950cdfc17dee735ffacfd462abc6646e11
BLAKE2b-256 checksum
How to use checksums
01893c81d850dabbcc6c14ec7eec01ac2e1b377f511ccd9b4b1ac9c77a6ba8f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / drmeter-0.4.9-py3-none-any.whl

Download URL drmeter-0.4.9-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
940dc6ea4d3195bde24ef695e816ec8ec7c0450cea66cfb1e83a1077e8ef0c22
BLAKE2b-256 checksum
How to use checksums
3120576b5f9798935484d5898fd278e5eceb72c1ed3e0354ce5a6d6baec5311e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page