Audio Mixing
Combine the TTS speech audio and Lyria background music into a single, polished radio show file.
Embedded Script
python3 skills/audio-mixing/scripts/mix_audio.py --workspace ./workspace
Arguments
| Argument |
Default |
Description |
--workspace |
workspace |
Root workspace directory |
What it does
- Loads speech from
{workspace}/audio/speech/speech.wav.
- Adds 3 seconds of silence padding to the end of the speech to prevent it from being faded out.
- Loads background music from
{workspace}/audio/music/background.mp3 (if exists).
- Loops music to match speech duration, lowers volume to -18dB.
- Overlays speech on music with a 1-second music intro.
- Adds fade-in/fade-out.
- Exports as MP3.
Dependencies
Mixing Guidelines
| Element |
Level |
Notes |
| Speech |
0 dB |
Untouched, full volume |
| Background music |
-18 dB |
Barely audible — subtle bed under speech |
Transitions
- Music fade-in: 3 seconds
- Music fade-out: 5 seconds
- Overall fade-in: 500ms
- Overall fade-out: 2 seconds
Output
| File |
Path |
Format |
| MP3 (distribution) |
{workspace}/audio/final/ai_radio.mp3 |
MP3, 192kbps |
Fallback
If no background music exists, produces speech-only output with just fade-in/fade-out applied.