This tool analyzes audio files for quality metrics such as bit rate, frequency, and codec type. It also generates spectrograms for visual representation of the audio spectrum. It supports a variety of audio formats, including MP3, FLAC, WAV, AAC, M4A, and more.
- Analyze audio files for detailed quality metrics.
- Generate spectrograms for audio visualization.
- Supports multiple file types:
mp3
,flac
,wav
,aac
,ogg
,m4a
,aiff
. - Batch processing of files in a directory.
- Recursive directory scanning.
- Multi-threaded processing for faster analysis.
- Python 3.7 or later
- FFmpeg (for metadata extraction and file decoding)
- Required Python libraries (see
requirements.txt
)
-
Clone the repository:
git clone https://github.com/oren-cohen/whatsmybitrate.git cd whatsmybitrate
-
Install Python dependencies:
pip install -r requirements.txt
-
Install FFmpeg:
- Linux:
sudo apt update sudo apt install ffmpeg
- MacOS:
brew install ffmpeg
- Windows:
- Download FFmpeg from ffmpeg.org.
- Extract the archive and add the
bin
folder to your system's PATH.
To verify FFmpeg installation, run:
ffmpeg -version
- Linux:
Analyze all audio files in the current and generate a report:
python whatsmybitrate.py -f report.html -l -a
Argument | Description |
---|---|
-f <file> |
Output HTML file name (required). |
-l |
Enable logging. |
-a |
Analyze all supported audio types. |
-t <type> |
Analyze a specific file type (e.g., mp3 , wav ). |
-r |
Scan directories recursively. |
-m <threads> |
Number of threads to use for analysis (default: 1). |
<input> |
Specify individual files or patterns (e.g., *.mp3 , *.wav ). |
-
Analyze all files in a directory recursively:
python whatsmybitrate.py -f analysis.html -l -a -r /path/to/directory
-
Analyze only
mp3
files in a directory recursively:python whatsmybitrate.py -f mp3_analysis.html -t mp3 -r /path/to/directory
-
Analyze specific files:
python whatsmybitrate.py -f specific_files.html file1.mp3 file2.wav
- WAV
- FLAC
- MP3
- AAC
- OGG
- M4A
- AIFF
- HTML Report: Contains detailed metrics for each file, including:
- Codec
- Sample Rate
- Max Frequency
- Nyquist Frequency
- Frequency Ratio
- Stated Bit Rate
- Estimated Bitrate
- Spectrogram image (if generated).
Ensure FFmpeg is installed and added to your system's PATH. Test the installation by running:
ffmpeg -version
If spectrograms are missing:
- Ensure
matplotlib
andlibrosa
are installed:pip install matplotlib librosa
- Check that the audio file is not corrupt or unsupported.
If the script encounters errors, enable logging with the -l
flag. Review the logs for detailed error messages.
This project is not licensed. Do you want you want with it. :)
If you encounter any issues, feel free to open an issue on the GitHub repository.