> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sunoapi.org/llms.txt
> Use this file to discover all available pages before exploring further.

# 转换为WAV格式

> 将现有音乐转换为高质量WAV格式。

### 使用指南

* 提供 taskId 或 audioId 来标识源音轨
* WAV格式适合专业音频编辑和制作
* 转换过程保留完整音频质量

### 开发者注意事项

1. 生成的WAV文件将保留15天
2. WAV文件比MP3文件大得多
3. 此格式推荐用于进一步音频处理或专业用途
4. 回调在转换完成时提供单个下载URL


## OpenAPI

````yaml cn/suno-api/suno-api-cn.json POST /api/v1/wav/generate
openapi: 3.0.0
info:
  title: intro
  description: 这是生成音频的API接口文档
  version: 1.0.0
  contact:
    name: 技术支持
    email: support@sunoapi.org
servers:
  - url: https://api.sunoapi.org
    description: API 服务器
security:
  - BearerAuth: []
tags:
  - name: Music Generation
    description: 用于创建和管理音乐生成任务的接口
  - name: Lyrics Generation
    description: 用于歌词生成和管理的接口
  - name: WAV Conversion
    description: 用于将音乐转换为WAV格式的接口
  - name: Vocal Removal
    description: 用于从音乐轨道中移除人声的接口
  - name: Music Video Generation
    description: 用于生成MP4视频的接口
  - name: Account Management
    description: 用于账户和积分管理的接口
paths:
  /api/v1/wav/generate:
    post:
      summary: 转换为WAV格式
      operationId: convert-to-wav-format
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - taskId
                - audioId
                - callBackUrl
              properties:
                taskId:
                  type: string
                  description: 音乐生成任务的任务ID。
                  example: 5c79****be8e
                audioId:
                  type: string
                  description: |-
                    要转换的特定音轨的音频ID。  
                    - 提供特定的 `audioId` 确保转换确切的音轨，特别是当一个任务有多个音轨时。
                  example: e231****-****-****-****-****8cadc7dc
                callBackUrl:
                  type: string
                  format: uri
                  description: >-
                    接收WAV转换完成通知的URL。  

                    - 必填。  

                    - 回调包含转换后的WAV文件的单个下载URL。

                    - 详细的回调格式和实现指南，请参见
                    [WAV格式转换回调](https://docs.sunoapi.org/cn/suno-api/convert-to-wav-format-callbacks)

                    - 或者，您也可以使用获取WAV转换详情接口来轮询任务状态
                  example: https://api.example.com/callback
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      code:
                        type: integer
                        enum:
                          - 200
                          - 400
                          - 401
                          - 404
                          - 405
                          - 409
                          - 413
                          - 429
                          - 430
                          - 455
                          - 500
                        description: |-
                          # 状态码

                          - ✅ 200 - 请求成功
                          - ⚠️ 400 - 无效参数
                          - ⚠️ 401 - 未授权访问
                          - ⚠️ 404 - 无效的请求方法或路径
                          - ⚠️ 405 - 超出速率限制
                          - ⚠️ 409 - 冲突 - WAV记录已存在
                          - ⚠️ 413 - 主题或提示词过长
                          - ⚠️ 429 - 积分不足
                          - ⚠️ 430 - 您的调用频率过高，请稍后重试
                          - ⚠️ 455 - 系统维护中
                          - ❌ 500 - 服务器错误
                      msg:
                        type: string
                        description: Error message when code != 200
                        example: success
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          taskId:
                            type: string
                            description: 任务ID，用于后续查询任务状态
                            example: 5c79****be8e
        '500':
          $ref: '#/components/responses/Error'
      callbacks:
        wavGenerated:
          '{$request.body#/callBackUrl}':
            post:
              description: |-
                当WAV格式音频生成完成时，系统会调用此回调通知结果。

                ### 回调示例
                ```json
                {
                  "code": 200,
                  "msg": "success",
                  "data": {
                    "audioWavUrl": "https://example.com/s/04e6****e727.wav",
                    "task_id": "988e****c8d3"
                  }
                }
                ```
              requestBody:
                content:
                  application/json:
                    schema:
                      type: object
                      properties:
                        code:
                          type: integer
                          description: 状态码
                          example: 200
                        msg:
                          type: string
                          description: 返回消息
                          example: success
                        data:
                          type: object
                          properties:
                            task_id:
                              type: string
                              description: 任务ID
                            audioWavUrl:
                              type: string
                              description: WAV格式音频文件URL
              responses:
                '200':
                  description: 回调接收成功
              method: post
              type: path
            path: '{$request.body#/callBackUrl}'
components:
  responses:
    Error:
      description: 服务器异常
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |-
        # 🔑 API 认证说明

        所有接口都需要通过 Bearer Token 方式进行认证。

        ## 获取 API Key

        1. 访问 [API Key 管理页面](https://sunoapi.org/api-key) 获取您的 API Key

        ## 使用方式

        在请求头中添加：

        ```
        Authorization: Bearer YOUR_API_KEY
        ```

        > **⚠️ 注意：**
        > - 请妥善保管您的 API Key，不要泄露给他人
        > - 如果怀疑 API Key 泄露，请立即在管理页面重置

````