ElevenLabs Music Generation
Generate complete songs from text prompts with AI-generated lyrics and vocals.
Quick Start
CODEBLOCK0
Options
| Flag | Description |
|---|
| INLINECODE0 | Duration in seconds (3-600, default: 30) |
| INLINECODE1 |
Output file path (default: /tmp/music.mp3) |
|
-i, --instrumental | Force instrumental, no vocals |
Prompt Engineering Tips
Be Specific About Style
- - Include genre, mood, tempo, and instruments
- Reference decades or eras: "90s Brazilian romantic pagode", "1960s sci-fi TV theme"
- Describe energy: "builds from soft to explosive", "relaxed and intimate"
For Vocals
- - Specify language: "vocals in Portuguese", "singing in Japanese"
- Describe vocal style: "soulful male vocals", "ethereal female choir"
- Include lyrical themes: "about love and saudade", "celebrating friendship"
Avoid Copyright Issues
- - Don't mention artist/band names directly
- Describe the style instead: "classic 90s romantic samba style" not "like Raça Negra"
- If rejected, the API returns a suggested alternative prompt
Example Prompts
MPB (Brazilian Popular Music)
CODEBLOCK1
Epic Orchestral
CODEBLOCK2
Lullaby
CODEBLOCK3
Comedy Rock
CODEBLOCK4
Requirements
- - ElevenLabs API Key: Set
ELEVENLABS_API_KEY environment variable - Paid Plan: Music API requires Creator plan or higher
- uv: For running the Python script with dependencies
Supported Features
- - Text-to-music generation up to 10 minutes
- AI-generated lyrics and vocals in multiple languages (English, Spanish, Portuguese, German, Japanese, etc.)
- Instrumental-only mode
- Most musical styles and genres
ElevenLabs 音乐生成
通过文本提示生成完整歌曲,包含AI生成的歌词和人声。
快速开始
bash
基础生成(30秒)
uv run {baseDir}/scripts/generate_music.py 欢快的爵士钢琴
较长曲目(3分钟)
uv run {baseDir}/scripts/generate_music.py 史诗管弦乐战斗音乐 --length 180
纯器乐(无演唱)
uv run {baseDir}/scripts/generate_music.py 低保真嘻哈节拍 --length 120 --instrumental
自定义输出路径
uv run {baseDir}/scripts/generate_music.py 浪漫波萨诺瓦 -o /tmp/bossa.mp3
选项
| 标志 | 描述 |
|---|
| -l, --length | 时长(秒,范围3-600,默认30) |
| -o, --output |
输出文件路径(默认:/tmp/music.mp3) |
| -i, --instrumental | 强制纯器乐,无演唱 |
提示词设计技巧
明确风格
- - 包含流派、情绪、速度和乐器
- 引用年代或时期:90年代巴西浪漫帕戈德、1960年代科幻电视剧主题曲
- 描述能量:从柔和逐渐爆发、放松而亲密
关于演唱
- - 指定语言:葡萄牙语演唱、日语演唱
- 描述演唱风格:深情男声、空灵女声合唱
- 包含歌词主题:关于爱情和乡愁、歌颂友谊
避免版权问题
- - 不要直接提及艺术家/乐队名称
- 描述风格而非模仿:经典90年代浪漫桑巴风格而非像Raça Negra
- 如被拒绝,API会返回建议的替代提示
示例提示
MPB(巴西流行音乐)
一首深情的MPB曲目,以轻柔的原声吉他、温暖的尼龙弦和梦幻的罗兹钢琴为特色。波萨诺瓦风格的节奏配合轻柔的刷鼓。葡萄牙语演唱表达了对乡愁和生活之美的主题。
史诗管弦乐
史诗般的军队进行曲,配有强大的铜管号角、雷鸣般的定音鼓和高亢的合唱。胜利而英勇,包含深沉的低音大号、大胆的小号、小军鼓滚奏,以及逐渐推向辉煌高潮的颂歌旋律。
摇篮曲
温柔的管弦乐摇篮曲,配以流畅的弦乐、柔和的铜管和空灵的无词女高音演唱。宁静而庄严,唤起惊奇与希望。适合在梦想冒险中入睡。
喜剧摇滚
巴西喜剧摇滚,歌词荒诞搞笑,充满文字游戏。将充满活力的摇滚吉他与出人意料的节奏混合——福罗舞曲的间奏、帕戈德的瞬间。戏剧化、夸张的演唱,讲述荒谬的情境。
要求
- - ElevenLabs API密钥:设置ELEVENLABSAPIKEY环境变量
- 付费计划:音乐API需要创作者计划或更高版本
- uv:用于运行带依赖的Python脚本
支持功能
- - 文本生成音乐,最长10分钟
- AI生成的歌词和演唱,支持多种语言(英语、西班牙语、葡萄牙语、德语、日语等)
- 纯器乐模式
- 大多数音乐风格和流派