GitHub
v1.7.2

Bake Auto Gain Into Your Files.
Before You Export.

Rekordbox Auto Gain doesn't work on CDJs. headroom simulates Auto Gain and permanently applies it to your filesโ€”so every track hits the same level on the booth.

The CDJ Auto Gain Problem

Rekordbox's Auto Gain feature analyzes your tracks and calculates gain adjustments to normalize loudness. It works great with controllers.

But when you export to USB for CDJs, Auto Gain values are ignored.

  • Quiet tracks from smaller labels need +3~4dB trim boost
  • Old releases and CD rips are often much quieter
  • Constant trim adjustments mid-set break your flow
  • Risk of clipping if you forget to reset trim
Current Workflow
Rekordbox analyzes track โ†’ Auto Gain: +2.5dB
โ†“
Export to USB
โ†“
CDJ ignores Auto Gain value
โ†“
Track plays too quiet โ†’ Manual trim adjustment

The Solution: Bake It In

headroom simulates what Rekordbox Auto Gain doesโ€”but instead of storing a metadata value, it permanently applies the gain to your audio files.

headroom Workflow
headroom analyzes track โ†’ Headroom: +2.5dB
โ†“
Gain baked into audio file
โ†“
Export to USB (Rekordbox metadata preserved)
โ†“
CDJ plays at correct level

Same Algorithm, Permanent Result

headroom uses the same approach as Rekordbox Auto Gain: it measures True Peak and calculates maximum safe gain without clipping.

  • Analyzes LUFS and True Peak (same as Rekordbox)
  • Supports FLAC, AIFF, WAV, MP3, and AAC/M4A
  • Applies gain without limiting or compression
  • Preserves all Rekordbox metadata
Terminal โ€” v1.7.2
$ headroom

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ headroom v1.7.2 โ”‚
โ”‚ Audio Loudness Analyzer & Gain โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โœ“ Found 28 audio files
โœ“ Analyzed 28 files

โ— 3 lossless files (ffmpeg, precise gain)
Filename LUFS True Peak Target Gain
track01.flac -13.3 -3.2 dBTP -0.5 dBTP +2.7 dB

โ— 2 MP3 files (native lossless, 1.5dB steps, target: -2.0 dBTP)
Filename LUFS True Peak Target Gain
track04.mp3 -14.0 -5.5 dBTP -2.0 dBTP +3.0 dB

โ— 2 AAC/M4A files (native lossless, 1.5dB steps)
Filename LUFS True Peak Target Gain
track08.m4a -13.0 -4.0 dBTP -1.0 dBTP +3.0 dB

โ— 2 MP3 files (re-encode required for precise gain)
Filename LUFS True Peak Target Gain
track06.mp3 -12.0 -1.5 dBTP -0.5 dBTP +1.0 dB

โ— 1 AAC/M4A files (re-encode required)
Filename LUFS True Peak Target Gain
track10.m4a -12.5 -1.8 dBTP -0.5 dBTP +1.3 dB

? Apply lossless gain adjustment to 3 lossless + 2 MP3 + 2 AAC/M4A (lossless gain) files? [y/N] y

โ„น 2 MP3 + 1 AAC/M4A files have headroom but require re-encoding.
โ€ข Re-encoding causes minor quality loss (inaudible at 256kbps+)
โ€ข Original bitrate will be preserved
? Also process these files with re-encoding? [y/N] y

โœ“ Done! 10 files processed.
โ€ข 3 lossless files (ffmpeg)
โ€ข 2 MP3 files (native, lossless)
โ€ข 2 AAC/M4A files (native, lossless)
โ€ข 2 MP3 files (re-encoded)
โ€ข 1 AAC/M4A files (re-encoded)

Smart Format Processing

headroom intelligently chooses the best method for each file based on format and available headroom, prioritizing quality preservation.

FLAC / AIFF / WAV
โ†“
Lossless ffmpeg volume filter Floating-point arbitrary precision
Target: โˆ’0.5 dBTP ceiling
MP3 / AAC / M4A
โ†“
Headroom โ‰ฅ 1.5 dB?
Yes
โ†“
Lossless Built-in mp3rgain Truly lossless global_gain
1.5 dB step increments
No
โ†“
Opt-in Re-encode Arbitrary precision gain
Preserves original bitrate

Files already at optimal level are automatically skipped.

Why Re-encoding is Safe at High Bitrates

A common concern is quality loss when re-encoding MP3/AAC. However, for gain adjustment only at high bitrates (โ‰ฅ256 kbps), the degradation is completely inaudible.

  • Quantization noise below -90dB โ€” far below audible threshold
  • ABX tests confirm โ€” listeners cannot distinguish 320kbpsโ†’320kbps re-encodes
  • Waveform preserved โ€” gain is simple multiplication, no compression or EQ applied
  • Club environment โ€” any theoretical difference is masked by ambient noise and PA characteristics
  • High-quality encoders โ€” headroom uses libmp3lame/libfdk_aac with best quality settings

Built for Rekordbox DJs

Everything you need for consistent levels on CDJs.

๐Ÿ“ฆ

Single Binary

mp3rgain is built-in as of v1.3.0. Only ffmpeg required as external dependency. Simple installation.

๐ŸŽต

AAC/M4A Lossless

Native lossless gain for AAC/M4A via mp3rgain 2.0. Re-encode fallback for precise gain.

๐ŸŽš๏ธ

Auto Gain Simulation

Uses the same LUFS/True Peak analysis as Rekordbox. Calculates maximum safe gain to hit optimal ceiling.

๐Ÿ’พ

Rekordbox Compatible

Files are modified in-place. All your cue points, hot cues, beat grids, and tags remain intact.

๐Ÿ”’

Non-Destructive

Original files are backed up before processing. Built-in mp3rgain MP3 processing is truly lossless.

๐Ÿ“Š

Smart True Peak Ceiling

Based on AES TD1008: -0.5 dBTP for lossless/high-bitrate, -1.0 dBTP for low-bitrate lossy.

Supported Formats

All the formats Rekordbox DJs actually use.

Format Method Precision Quality
FLAC ffmpeg volume filter Arbitrary Lossless
AIFF ffmpeg volume filter Arbitrary Lossless
WAV ffmpeg volume filter Arbitrary Lossless
MP3 mp3rgain (built-in) 1.5dB steps Lossless
MP3 ffmpeg re-encode (opt-in) Arbitrary Inaudible at โ‰ฅ256kbps
AAC/M4A mp3rgain (built-in) 1.5dB steps Lossless
AAC/M4A ffmpeg re-encode (opt-in) Arbitrary Inaudible at โ‰ฅ256kbps

Why headroom?

The free, open-source DJ loudness normalizer โ€” with features paid tools don't offer.

Feature headroom Paid Alternatives
Price Free & Open Source (MIT) โ‚ฌ15+
macOS โœ“ โœ— Windows only
Linux โœ“ โœ—
AIFF Support โœ“ Lossless โœ—
AAC/M4A Support โœ“ Lossless gain โœ—
Lossless MP3 Gain โœ“ global_gain mod Unknown
True Peak Ceiling AES TD1008 bitrate-aware Basic
Rekordbox Metadata โœ“ Preserved Unknown
Automatic Backup โœ“ โœ—
GUI โœ— CLI only โœ“

headroom is a CLI tool designed for DJs who want maximum control and transparency over their loudness normalization workflow.

Installation

Requires ffmpeg. Package managers install it automatically.

macOS (Homebrew)

brew install M-Igashi/tap/headroom

Windows (winget)

winget install M-Igashi.headroom

Cargo / Pre-built Binaries

cargo install headroom

ffmpeg must be installed separately. Pre-built binaries on GitHub Releases.

Stop adjusting trim on the booth.

Run headroom before your next USB export and play with consistent levels.