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 installing drmeter
is pipx:
pipx install drmeter
Any regular pip install drmeter
will do, too. The drmeter
requires Python 3.9+ to run.
To use drmeter
without installation, consider the dockerized approach below
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
Dockerized
A container image of drmeter
is available at ghcr.io/janw/drmeter
with the latest
tag pointing to the latest commit on the main
branch. The following command (with the files you're looking to analyze in/below the current working directory) behaves very similarly to an installed version, accepting arguments directly as expected:
docker run --rm --tty --workdir /src -v "$PWD:/src" \
ghcr.io/janw/drmeter --output json path/to/files
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
File details
Details for the file drmeter-0.3.2.tar.gz
.
File metadata
- Download URL: drmeter-0.3.2.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7572b7c7975bf9865116379882b47dc8bf00ba222c50e75cb1a1832a4076bd8d |
|
MD5 | d4ff538c1d11b60db2861d6fc13d9fa6 |
|
BLAKE2b-256 | 3831b5ffe8001ec3086a750e0ed9805f334f8fe124d77a1a7b20ec329daeb8ae |
Provenance
File details
Details for the file drmeter-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: drmeter-0.3.2-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a265d15fd5f84bc884ae2a12f4819bd84478808f60f05dd5e9f72fb018721341 |
|
MD5 | e39514d1db0eebdf684b29c7f4551db8 |
|
BLAKE2b-256 | 04744f9918ed78e86d779dfec54f6f169292da7049825320ce90bd64f83d4c1d |