> ## 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.

# Producer アップロード参考音声 API 連携説明

> Producer Music Generation 集成指南 - XHuoAPI

Producer は私たちが参考音声をアップロードして二次創作を行うことを許可します。本ドキュメントでは関連する API の連携方法を説明します。

この API には一つの入力パラメータしかなく、それは `audio_url` です。これは公開アクセス可能な CDN アドレスで、mp3 拡張子をサポートしています。

ここで入力する `audio_url` は `https://cdn.xhuoapi.ai/suno_demo.mp3` で、公開アクセス可能な CDN アドレスです。

```bash theme={null}
curl -X POST 'https://api.xhuoapi.ai/v1/producer/upload' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "audio_url": "https://cdn.xhuoapi.ai/suno_demo.mp3"
}'
```

結果は以下の通りです：

```
{
  "success": true,
  "task_id": "23e7d4ec-d1a8-429f-87d8-9f53fc3b6666",
  "data": {
    "audio_id": "d906da31-87cb-42f5-98df-2fc4969923b1",
    "lyric": "[Mandopop, Acoustic Pop]\n[Soft female vocals, bright and cheerful]\n\n[Verse 1]\n陽光が海辺に降り注ぎ\n波が笑顔で輝く\nあなたと私が砂浜に\n時計が止まる\nアイスクリームが溶けていく\n手をつないで散歩\n風が優しく吹き抜け\n心臓が止まらずに鼓動する\n\n[Chorus]\n夏、夏\n時間がこの日で止まる\n笑い声が響き\n青い空がそばにある",
    "audio_url": "https://storage.googleapis.com/corpusant-app-public/producer/raw/d906da31-87cb-42f5-98df-2fc4969923b1.mp3"
  }
}
```

`data` の `audio_id` フィールドがアップロード後の曲の ID であることがわかります。

曲の ID を取得した後、[Producer Audios Generation API](https://api.xhuoapi.ai/documents/producer-audios-integration) を使用してカスタム曲の生成を行うことができます。例えば、`action` に `upload_extend` を渡し、`audio_id` に返された曲の ID を渡すことで、参考音声に基づいて新しい曲を生成することができます。
