Generate music using ElevenLabs Music API - instrumental tracks, songs with lyrics, and fine-grained composition plans
95
93%
Does it follow best practices?
Impact
99%
1.57xAverage score across 5 eval scenarios
Passed
No findings from the security scan
A podcast production company wants to add auto-generated background music to their episodes. They've chosen the ElevenLabs Music API for this. They need a Python command-line tool that takes a mood description (e.g. "calm ambient background") and a duration in seconds, then generates an MP3 file.
The tool should be a single Python script called generate_bgm.py that:
The team wants this to be a clean, production-ready script they can integrate into their pipeline.
generate_bgm.py — The Python scriptrequirements.txt — Python dependencies needed