When releasing an EP or album independently, achieving consistent sound quality and loudness across tracks can be challenging and time-consuming. Automating the mastering process not only saves time but ensures sonic consistency throughout your project, providing listeners with a cohesive experience.
Mastering an album or EP track-by-track can lead to inconsistent loudness levels and sonic character, causing your project to lose coherence. Batch mastering allows you to set consistent mastering parameters across your entire project, ensuring uniform loudness, style, and sound quality.
Before you begin, you'll need:
- Python installed on your machine (Download here)
- The
requestsPython package (pip install requests) - An API key from tonn-portal.roexaudio.com
Each track requires:
- trackURL: URL of your track file (WAV, MP3, or FLAC)
- musicalStyle: Genre-specific mastering preset (e.g., ROCK_INDIE, POP, ELECTRONIC)
- desiredLoudness: Desired loudness level (QUIET, MEDIUM, or LOUD)
- sampleRate: Optional, defaults to "44100"
- webhookURL: Optional URL to receive API callbacks
When you run batch mastering, here's what happens for each track:
- Upload (~5 seconds) - Track uploaded to cloud storage
- Preview (~30-60 seconds) - Mastering preview created
- Final Master (~30 seconds) - Full quality master generated
- Download - Mastered file saved
Typical runtime: ~2 minutes per track.
For a 5-track EP, expect approximately 10 minutes total.
cd python/examples
# Master all files in a directory
python 06_batch_mastering.py ./my_album
# Specify options
python 06_batch_mastering.py ./my_album \
--output-dir ./masters \
--style POP \
--loudness MEDIUM| Option | Description | Default |
|---|---|---|
input_dir |
Directory containing audio files | Required |
-o, --output-dir |
Where to save mastered files | ./mastered_output |
--style |
Musical style | ROCK_INDIE |
--loudness |
QUIET, MEDIUM, or LOUD | MEDIUM |
--sample-rate |
Output sample rate | 44100 |
For each supported audio file in the directory:
- Upload: Sends your track to cloud storage
- Preview: Creates a mastering preview
- Poll: Waits until the preview is ready
- Final Master: Retrieves the fully mastered track
- Download: Saves the mastered file to your output directory
Choose the same loudness level (MEDIUM is typically industry-standard at around -14 LUFS) across all tracks for a cohesive listening experience.
Carefully select the musical style to match your project accurately; this ensures genre-specific optimizations are applied.
- 44100 Hz: Standard for CD and audio distribution
- 48000 Hz: Typical for video production and higher-resolution streaming
Your mastered tracks will be downloaded into your output directory. It's crucial to listen critically to each mastered track and ensure they meet your expectations for:
- Loudness consistency
- Tonal balance
- Overall cohesiveness
============================================================
BATCH MASTERING
============================================================
Input: ./my_album
Output: ./masters
Style: POP
Loudness: MEDIUM
Tracks: 5
============================================================
Processing: track_01_intro.wav
============================================================
📤 Uploading...
✓ File uploaded successfully
🎚️ Creating mastering preview...
✓ Preview task created: abc123...
⏳ Waiting for preview...
Attempt 1/30: Processing
Attempt 2/30: Processing
✓ Processing complete!
📥 Retrieving final master...
✓ Downloaded: ./masters/track_01_intro_mastered.wav
... (continues for each track)
============================================================
BATCH MASTERING COMPLETE
============================================================
✅ Successful: 5
Mastered files saved to: ./masters
For further assistance:
- Visit tonn-portal.roexaudio.com
- Contact: support@roexaudio.com