Get up and running with the Tonn API in 5 minutes.
- Go to tonn-portal.roexaudio.com
- Sign up or log in
- Copy your API key
# Clone the repo
git clone https://github.com/roex-audio/TonnExamples.git
cd TonnExamples
# Install dependencies
pip install requests
# Set your API key
export TONN_API_KEY=your_api_key_here
# Run an example
cd python/examples
python 01_mix_analysis.py /path/to/track.wav POP# Clone the repo
git clone https://github.com/roex-audio/TonnExamples.git
cd TonnExamples/nodejs
# Install dependencies
npm install
# Set your API key
export TONN_API_KEY=your_api_key_here
# Run an example
node src/examples/01_mix_analysis.js /path/to/track.wav POPYou'll see output like:
📤 Uploading track.wav...
✓ Upload URLs obtained successfully
✓ File uploaded successfully
🔍 Analyzing your mix...
✅ Analysis complete
============================================================
MIX DIAGNOSIS RESULTS
============================================================
--- Technical Details ---
Bit Depth: 24
Sample Rate: 44100
Integrated Loudness (LUFS): -14.2
Peak Loudness (dBFS): -1.0
Stereo Field: STEREO
Mono Compatible: True
--- Recommendations ---
1. Loudness is appropriate for streaming platforms
2. Good dynamic range preserved
...
| Example | What it does |
|---|---|
01_mix_analysis |
Analyze a mix for technical issues |
02_mix_comparison |
Compare two mixes side-by-side |
03_mix_enhance |
Auto-enhance a stereo mix |
04_multitrack_mix |
Mix multiple stems together |
05_audio_cleanup |
Clean up noisy recordings |
06_batch_mastering |
Master an entire album |
Python:
from shared import TonnClient
client = TonnClient()
# Upload your audio file
url = client.upload_local_file("my_track.wav")
# Call any API endpoint
response = client.post("/mixanalysis", {
"mixDiagnosisData": {
"audioFileLocation": url,
"musicalStyle": "POP",
"isMaster": False
}
})Node.js:
import { TonnClient } from './src/shared/client.js';
const client = new TonnClient();
// Upload your audio file
const url = await client.uploadLocalFile('my_track.wav');
// Call any API endpoint
const response = await client.post('/mixanalysis', {
mixDiagnosisData: {
audioFileLocation: url,
musicalStyle: 'POP',
isMaster: false
}
});Make sure you've set your API key:
export TONN_API_KEY=your_api_key_hereOr create a .env file in the project root:
TONN_API_KEY=your_api_key_here
Use absolute paths or make sure you're in the correct directory:
# Absolute path (recommended)
python 01_mix_analysis.py /Users/you/Music/track.wav POP
# Or relative from examples directory
cd python/examples
python 01_mix_analysis.py ../../my_track.wav POPSee the full Troubleshooting Guide.