Documentation Index
Fetch the complete documentation index at: https://docs.xhuoapi.ai/llms.txt
Use this file to discover all available pages before exploring further.
SUNO は生成された音楽の二次創作を可能にし、音楽の歌詞やオーディオタイムラインを取得できます。本ドキュメントでは関連 API の接続方法について説明します。
この API は入力パラメータが一つだけで、それが audio_id です。これは公式が生成した楽曲IDです。
ここで入力する audio_id は ec13e502-d043-4eb2-92ee-e900c6da69d1 です。
import requests
url = "https://api.xhuoapi.ai/v1/suno/timing"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}",
"content-type": "application/json"
}
payload = {
"audio_id": "ec13e502-d043-4eb2-92ee-e900c6da69d1"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
結果の抜粋は以下の通りです:
{
"success": true,
"task_id": "ccf72cca-1c82-4580-8575-bb141c7e8e48",
"trace_id": "d8e0b7c3-6d24-4ed9-98ac-ffe683576a75",
"data": {
"aligned_words": [
{
"word": "[Verse]\nSnowflakes ",
"success": true,
"start_s": 2.63,
"end_s": 3.43,
"p_align": 0.531
},
{
"word": "dance ",
"success": true,
"start_s": 3.43,
"end_s": 3.91,
"p_align": 0.911
},
{
"word": "on ",
"success": true,
"start_s": 3.91,
"end_s": 4.35,
"p_align": 0.937
},
{
"word": "rooftops ",
"success": true,
"start_s": 4.35,
"end_s": 5.11,
"p_align": 0.366
},
{
"word": "high\n",
"success": true,
"start_s": 5.11,
"end_s": 6.25,
"p_align": 0.969
},
...
],
"waveform_data": [0.02138, 0.02193, 0.01806, 0.16597, 0.15168, 0.14243, ...],
"hoot_cer": 0.35013262599469497,
"is_streamed": false
}
}
aligned_words フィールド説明
ご覧の通り、data.aligned_words はオブジェクトの配列であり、各オブジェクトは時間情報を持つ単語またはフレーズを表します。
word: 歌詞中の実際の単語またはフレーズ
success: ブール値で、その単語のアラインメントが成功したかどうか
start_s: 単語の開始時間(秒)
end_s: 単語の終了時間(秒)
p_align: アラインメントの確率または信頼度スコア、0から1の範囲