# 🎵 True Peak Adjuster

Professional Audio True Peak Adjustment Tool

## 📋 Overview

True Peak Adjuster is a professional tool that accurately adjusts the True Peak of audio files to -0.1 dBTP. It uses FFmpeg's EBU R128 filter to perform industry-standard compliant True Peak measurement and adjustment.

### Key Features

- Accurate True Peak measurement with FFmpeg EBU R128
- Support for WAV, FLAC, and ALAC (M4A) formats
- Complete preservation of metadata and cover art
- Simple drag-and-drop operation
- Batch processing of multiple files and folders
- Support for all sample rates and bit depths

## 💻 System Requirements

Item | Requirement
--- | ---
Operating System | Windows 10 / Windows 11
Required Software | FFmpeg (added to system PATH)
Supported Formats | WAV (.wav), FLAC (.flac), ALAC (.m4a)
Sample Rate | 8kHz ~ 384kHz (all supported)
Bit Depth | 16bit, 24bit, 32bit, 32bit float, 64bit float

## 🔧 Installation

### 1Installing FFmpeg

FFmpeg is required. Follow these steps to install:

1. Download "ffmpeg-release-essentials.zip" from https://www.gyan.dev/ffmpeg/builds/
2. Extract the ZIP file (e.g., to C:\ffmpeg)
3. Add to system environment variable PATH (e.g., C:\ffmpeg\bin)
4. Verify installation by running `ffmpeg -version` in Command Prompt

💡 Tip: After installing FFmpeg, restart your computer to apply the PATH settings.

### 2Placing True Peak Adjuster

Simply place TruePeakAdjuster.exe in any folder to use it.

## 📖 How to Use

### Basic Usage

1. Double-click TruePeakAdjuster.exe to display usage instructions
2. Drag and drop audio files or folders onto TruePeakAdjuster.exe
3. Wait for processing to complete
4. Output files with "_TP" suffix will be saved in the same location as original files

### Supported Operations

- Single file drop → Process that file
- Multiple files drop → Process all files
- Folder drop → Process all supported files directly in the folder

⚠️ Note: When dropping a folder, files in subfolders will not be processed. Only files directly in the folder will be processed.

### Output File Names

Processed files have "_TP" suffix added to the original file name:

Examples:
song.wav → song_TP.wav
album.flac → album_TP.flac
track.m4a → track_TP.m4a

## 🎯 Technical Specifications

### True Peak Measurement

Uses FFmpeg's ebur128 filter to perform accurate True Peak measurement compliant with EBU R128 standards. This method detects inter-sample peaks, making it more accurate than traditional sample peak measurement.

### Target True Peak Value

Default: -0.1 dBTP

This value is set to ensure maximum loudness while preventing digital clipping.

### Metadata Preservation

Format | Preserved Metadata
--- | ---
WAV | ID3v2.3 tags + Cover art
FLAC | Vorbis Comment tags + Cover art (Picture)
ALAC | MP4 metadata + Cover art

### Processing Flow

1. Measure current True Peak with FFmpeg ebur128 filter
2. Calculate linear gain from difference with target value (-0.1 dBTP)
3. Apply gain to audio data
4. Verify True Peak of processed audio
5. Copy metadata and cover art from original file
6. Save output file

## 📊 Processing Examples

### Case 1: High True Peak

Current True Peak: 0.50 dBTP
Required Gain: -0.60 dB (Linear: 0.933254)
New True Peak: -0.10 dBTP

→ Reduce volume to adjust to -0.1 dBTP

### Case 2: Low True Peak

Current True Peak: -0.50 dBTP
Required Gain: 0.40 dB (Linear: 1.047129)
New True Peak: -0.10 dBTP

→ Increase volume to adjust to -0.1 dBTP

### Case 3: Already at Target Value

Current True Peak: -0.10 dBTP
Required Gain: 0.00 dB (Linear: 1.000000)
New True Peak: -0.10 dBTP

→ No gain adjustment (metadata only copied)

## ❓ Troubleshooting

### "FFmpeg is not available" Error

FFmpeg is not added to system PATH. Please check the following:

1. Is FFmpeg installed correctly?
2. Is FFmpeg's bin folder added to system environment variable PATH?
3. Have you restarted your computer?

### Metadata Not Preserved

The original file may not contain metadata. Please check the processed file with a media player.

### Processing is Slow

FFmpeg ebur128 measurement takes time as it analyzes the entire file. Processing time will be longer especially for long-duration audio files or high-resolution audio.

## ⚠️ Important Notes

- Original files are not modified (new files are created)
- Existing files with "_TP" suffix will be overwritten
- True Peak adjustment does not affect sound quality (linear gain only)
- If extreme gain changes are required, please check the original source

## 📝 Version History

Version | Date | Changes
--- | --- | ---
1.0.0 | 2025-11-26 | Initial release

## 📄 License

This software is free to use for both personal and commercial purposes.

Libraries Used:

- Python 3.x
- NumPy
- soundfile
- mutagen
- FFmpeg