English | 简体中文
A small audio loudness matching tool written with PyQt5, currently supporting ITU-R BS.1770 (LUFS), average loudness (dBFS), maximum peak (dBFS), total RMS (dB), four matching modes.
You can directly go to releases to download the installer or the portable version.
- Clone this repository
git clone https://github.com/SUC-DriverOld/Loudness-Matching-Tool.git
- Install dependencies
pip install -r requirements.txt
-
Download ffmpeg and place
ffmpeg.exe
in the./ffmpeg
directory -
Launch using
gui.py
python gui.py
Use audio_processor.py
:
"-i", "--input_dir", Input directory containing audio files
"-o", "--output_dir", Output directory to save processed audio files
"-target", "--target_loudness", default=-23, Target loudness
"-type", "--loudness_type", default="LUFS", choices=["LUFS", "dBFS", "Peak_dBFS", "RMSdB"], Type of loudness to match
"--export_format", default="wav", choices=["wav", "flac", "mp3"], Audio export format
"--mp3_bitrate", default=320, choices=[128, 192, 256, 320], MP3 bitrate in kbps
"--ffmpeg_sample_rate", default=48000, choices=[32000, 44100, 48000], Output audio sample rate
"--ffmpeg_bit_depth", default=32, choices=[16, 24, 32], Output audio bit depth
Example:
python audio_processor.py -i input -o output -target -23 -type LUFS --export_format mp3 --mp3_bitrate 320
-
Currently supported loudness matching methods include:
- ITU-R BS.1770 (LUFS)
- Average loudness (dBFS)
- Maximum peak (dBFS) [NOT the True Peak!]
- Total RMS (dB)
-
Export formats support:
- Supported export audio formats:
wav
,mp3
,flac
- Supported mp3 bitrate settings:
320k
,256k
,192k
,128k
- Supported sample rates for export:
32000Hz
,44100Hz
,48000Hz
- Supported bit depths for export:
16bit
,24bit
,32 bit float
- Supported export audio formats:
-
Since format conversion is implemented using ffmpeg, some format export processes may be slower. The specific implementation methods are as follows:
- Import wav format -> match volume -> export wav format
- Import wav format -> match volume -> export wav format first -> then call ffmpeg to export mp3 or flac format
- Import mp3 or flac format -> match volume -> export wav format
- Import mp3 or flac format -> match volume -> export wav format first -> then call ffmpeg to export mp3 or flac format
Note
Therefore, it is recommended to use wav for both import and export formats here, which will greatly speed up processing time!
Pull requests are welcome if anyone can solve these issues!
- Due to pydub's inability to specify the ffmpeg path for export and the flashing console window when running the packaged program, the method used for format conversion when exporting to other formats is to first save as WAV format and then call ffmpeg for format conversion. Part of the code for the export operation is as follows. It may also be because I'm not skilled enough, so please bear with me. Details can be found at audio_processor.py#L35
- Pydub can only calculate peak, unable to calculate true peak, so it can only match the maximum peak, unable to match the actual maximum peak. Details can be found at audio_processor.py#L96
- In actual testing, some computers experienced flashing console windows. However, this problem does not occur in most cases. I am currently unable to reproduce this issue, so I cannot solve it temporarily.
- There is a chance that when exporting with the selected bit depth
24bit
, it may not export at the specified bit depth.