Dynamic Range (DR) algorithm implementation in python
Project description
Dynamic Range (DR) meter ๐ง
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
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 drmeter-0.4.9.tar.gz.
File metadata
- Download URL: drmeter-0.4.9.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
043f67f8bd3e970516e771f4f79e99950cdfc17dee735ffacfd462abc6646e11
|
|
| MD5 |
98ad907be2823456a25eae81ea380431
|
|
| BLAKE2b-256 |
01893c81d850dabbcc6c14ec7eec01ac2e1b377f511ccd9b4b1ac9c77a6ba8f7
|
File details
Details for the file drmeter-0.4.9-py3-none-any.whl.
File metadata
- Download URL: drmeter-0.4.9-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
940dc6ea4d3195bde24ef695e816ec8ec7c0450cea66cfb1e83a1077e8ef0c22
|
|
| MD5 |
4943445a24f6d1590cecf9f4c7d4fa31
|
|
| BLAKE2b-256 |
3120576b5f9798935484d5898fd278e5eceb72c1ed3e0354ce5a6d6baec5311e
|