histogram.py
is a Python utility designed to analyze and visualize audio files by generating histogram charts. These charts offer insights into the mastering process of albums, revealing details like compression and soft/hard clipping, which are often not captured by traditional dynamic range meters.
To use histogram.py
, ensure you have Python 3.8+ installed along with the following packages:
pip install numpy matplotlib soundfile
You can run the script from the command line as follows:
python3 histogram.py [options]
-
Process a single file:
python3 histogram.py path/to/audio.flac
-
Process a single album folder:
python3 histogram.py path/to/album
-
Process all album folders recursively:
python3 histogram.py /path/to/albums --recursive
-
Specify output image size and DPI:
python3 histogram.py /path/to/audio.flac --size 12 8 --dpi 150
-
Display the histogram in a window:
python3 histogram.py /path/to/audio.flac --window
-
Use custom regular expression for matching files:
python3 histogram.py /path/to/directory --match "\.wav$"
input
: Path to a file or directory (default: current working directory).-f, --filename
: Name of the output image file (default:histogram.png
).-r, --recursive
: Recursively process directories.-c, --concurrency
: Number of threads to use for processing (default: 1).-s, --size
: Output image size in inches (default:[10.24, 6.4]
).--dpi
: DPI for the output image (default:100
).-m, --match
: Regular expression to match files (default:(?i)\\.flac$
).-w, --window
: Display histogram in a window.-o, --overwrite
: Overwrite existing image files.
Feel free to open issues or submit pull requests if you have ideas for improvement or encounter any bugs.