# 📊 Audio Analyzer

EBU R128 Compliant Audio Analysis Tool

## 🎯 Overview

Audio Analyzer is a tool for detailed analysis of WAV/FLAC/M4A audio file quality. It uses FFmpeg's ebur128 filter and performs measurements in complete compliance with the EBU R128 standard.

What is EBU R128?

An international standard for audio loudness measurement established by the European Broadcasting Union (EBU). It enables accurate volume measurement based on human auditory characteristics and is widely adopted in professional environments including broadcasting, streaming, and music production.

### ✨ Key Features

- Measures 4 audio metrics
  RMS (Average Level) / LUFS (Loudness) / TP (True Peak) / LRA (Dynamic Range)
- Multi-format support - WAV, FLAC, M4A (AAC/ALAC)
- Parallel processing - Fast processing of multiple files (up to 4 cores)
- Log file output - Automatic saving of measurement results

## 📦 Distribution Files

File Name | Description
--- | ---
`audio_analyzer.exe` | Audio Analyzer main program
`audio_analyzer_readme_en.html` | User guide (this file)

## 📋 System Requirements

Item | Requirement
--- | ---
OS | Windows 10 or later
Other | FFmpeg Required

## ⚙️ Setup

### 1Install FFmpeg

💡 Installation Instructions:

1. Download from FFmpeg for Windows (Recommended: "ffmpeg-release-essentials.zip")
2. After extracting, add `ffmpeg.exe` to your system PATH environment variable

⚠️ Important: The tool cannot start without FFmpeg installed. If you see an error on first launch, verify FFmpeg installation.

## 🚀 How to Use

1. Drag and drop audio files or folders onto `audio_analyzer.exe` (or its shortcut)
2. Analysis starts automatically
3. Results are displayed in the console and saved as a log file

💡 Tips:

- You can drop multiple audio files at once for batch processing
- Dropping a folder processes audio files directly in that folder (subfolders excluded)
- Processing is automatically parallelized for high speed (up to 4 cores)

## 🎵 Supported Formats

Format | Extension | Characteristics
--- | --- | ---
WAV | .wav | Uncompressed, most common
FLAC | .flac | Lossless compression, used for high-quality distribution
M4A (AAC) | .m4a | Lossy compression, iTunes/Apple Music
M4A (ALAC) | .m4a | Lossless compression, Apple Lossless

💡 About M4A Files:

M4A file extension alone cannot distinguish the internal format (AAC or ALAC), but this tool automatically processes both.

## 📊 Understanding Measurements

Metric | Unit | Description | Guideline
--- | --- | --- | ---
RMS | dB | Average sound pressure level | -20dB ~ -10dB (for music)
LUFS | dB | Loudness considering human auditory characteristics | Spotify/Apple Music/YouTube: -14 LUFS CD/Music Production: -9 to -12 LUFS
TP | dBFS | True Peak - Actual peak level (clipping detection) | -1.0dBFS or lower recommended
LRA | LU | Dynamic Range (variation in sound) | 5-15 LU (varies by music genre)

## 📁 Output Files

### Log File

Measurement results are automatically saved in the following format:

- File name: `audio_analysis_log_YYYYMMDD_HHMMSS.txt`
- Save location: Folder containing analyzed files (for multiple folders, location of first file)
- Content: All measurement results and processing information

## 🔧 Auto-Optimization Features

### Automatic CPU Core Adjustment

This tool automatically detects available CPU cores and performs optimal parallel processing.

- Automatically detects available core count
- Uses up to 4 cores (balanced performance)
- Optimizes processing method based on file count

No special configuration needed. Simply drag and drop for optimal speed processing.

## ❓ Troubleshooting

### "FFmpeg is required" Error

Cause and Solution:

- FFmpeg is not installed or not in PATH
- Run `ffmpeg -version` in command prompt to verify
- Reinstall FFmpeg and add to PATH environment variable

### Slow Processing

Cause and Solution:

- By default, automatically uses up to 4 cores
- Parallelization benefits are limited with few files
- Files on network drives may process slower
- M4A files are slightly slower than WAV/FLAC due to conversion processing

## 🎓 Technical Specifications

### Measurement Method

- LUFS/TP/LRA: FFmpeg ebur128 filter (Full EBU R128 compliance)
- RMS: Average sound pressure calculated from audio waveform
- DC Removal: DC offset correction before True Peak measurement

### Format Support Details

- WAV/FLAC: Direct loading with soundfile library (fast)
- M4A: Converted to temporary WAV with FFmpeg before loading
- Sample rate: Any (M4A auto-converted to 48kHz/stereo)
- Bit depth: 16bit/24bit/32bit supported
- Channels: Mono/stereo supported

### Processing Flow (M4A)

1. FFmpeg converts M4A → temporary WAV file (48kHz/stereo)
2. soundfile loads temporary WAV
3. DC removal processing
4. RMS calculation
5. FFmpeg ebur128 measures LUFS/TP/LRA
6. Temporary file deleted

## 📄 License

This tool is free to distribute and use. For FFmpeg licensing, please refer to the FFmpeg official website.

Audio Analyzer - EBU R128 Compliant Audio Analysis Tool (WAV/FLAC/M4A Support)