← 返回
内容创作 Key

Songmaker

Generate a complete song from a text description — AI writes lyrics then composes music. Use when users want to create a song, turn a description into audio,...
根据文本描述生成完整歌曲——AI撰写歌词并谱曲。适用于用户想要创作歌曲或将描述转化为音频等场景。
scikkk
内容创作 clawhub v1.0.0 1 版本 99823.9 Key: 需要
★ 0
Stars
📥 567
下载
💾 22
安装
1
版本
#latest

概述

SenseAudio Songmaker

Two-step song creation: generate lyrics → compose music. If the user already has lyrics, skip to Step 2.

Workflow

用户描述 → [Step 1] 生成歌词 → 用户确认/修改 → [Step 2] 生成歌曲 → 返回链接
                                ↑ 用户自带歌词时跳过 Step 1

Step 1: Generate Lyrics

Skip this step if the user provides their own lyrics.

LYRICS_RESP=$(curl -s -X POST "https://api.senseaudio.cn/v1/song/lyrics/create" \
  -H "Authorization: Bearer $SENSEAUDIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"prompt\": \"<USER_PROMPT>\", \"provider\": \"sensesong\"}")

TASK_ID=$(echo $LYRICS_RESP | jq -r '.task_id // empty')

If task_id is present, poll until done:

while true; do
  POLL=$(curl -s "https://api.senseaudio.cn/v1/song/lyrics/pending/$TASK_ID" \
    -H "Authorization: Bearer $SENSEAUDIO_API_KEY")
  STATUS=$(echo $POLL | jq -r '.status')
  { [ "$STATUS" = "SUCCESS" ] || [ "$STATUS" = "FAILED" ]; } && break
  sleep 3
done
LYRICS=$(echo $POLL | jq -r '.response.data[0].text')

If no task_id (sync response), read directly:

LYRICS=$(echo $LYRICS_RESP | jq -r '.data[0].text')

Show the lyrics to the user and ask for confirmation or edits before proceeding.

Lyrics Format

The API uses structured section tags separated by ; :

[intro-medium] ; [verse] 第一段歌词内容 ; [chorus] 副歌内容 ; [bridge] 桥段 ; [outro-short]

Common tags: [intro-short] [intro-medium] [verse] [chorus] [bridge] [outro-short] [outro-medium] [inst-short]

If the user provides plain lyrics without tags, wrap them: [verse] ; [chorus]


Step 2: Generate Song

Build the request body from user preferences:

User saysParameter
----------------------
男声 / 男歌手"vocal_gender": "m"
女声 / 女歌手"vocal_gender": "f"
纯音乐 / 无人声"instrumental": true (omit lyrics)
风格描述(摇滚/流行/古风…)"style": "<描述>"
不要某种风格"negative_tags": "<描述>"
SONG_RESP=$(curl -s -X POST "https://api.senseaudio.cn/v1/song/music/create" \
  -H "Authorization: Bearer $SENSEAUDIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"model\": \"sensesong\",
    \"lyrics\": \"<LYRICS>\",
    \"title\": \"<TITLE>\",
    \"vocal_gender\": \"<f|m>\",
    \"style\": \"<STYLE>\"
  }")

SONG_TASK=$(echo $SONG_RESP | jq -r '.task_id')

Song generation always returns a task_id. Poll until done (may take 30–120s):

while true; do
  POLL=$(curl -s "https://api.senseaudio.cn/v1/song/music/pending/$SONG_TASK" \
    -H "Authorization: Bearer $SENSEAUDIO_API_KEY")
  STATUS=$(echo $POLL | jq -r '.status')
  { [ "$STATUS" = "SUCCESS" ] || [ "$STATUS" = "FAILED" ]; } && break
  echo "生成中... ($STATUS)"
  sleep 5
done

Output

On SUCCESS, extract and display:

echo $POLL | jq -r '.response.data[0] | "标题:\(.title)\n时长:\(.duration) 秒\n音频:\(.audio_url)\n封面:\(.cover_url)"'

Example output:

标题:夏日物语
时长:187 秒
音频:https://cdn.senseaudio.cn/songs/xxx.mp3
封面:https://cdn.senseaudio.cn/covers/xxx.jpg

On FAILED, report the status and suggest retrying with a different style or simpler lyrics.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 05:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Meeting Assistant

scikkk
用于构建和排查 SenseAudio 会议助手,覆盖实时会议转写、说话人区分、实时翻译、会议纪要生成、行动项提取与转录导出。Build and troubleshoot SenseAudio meeting assistants for l
★ 1 📥 1,564
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,199
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 860 📥 199,816