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

# 查询人声分离任务

> 查询异步人声分离任务的处理状态与结果。

## 说明

使用异步方式提交人声分离任务后，可通过本接口查询任务状态与分离结果。

## 状态说明

| 状态          | 说明                         |
| ----------- | -------------------------- |
| `pending`   | 任务已提交，正在排队或处理中             |
| `completed` | 任务处理成功，可读取 `result_url`    |
| `failed`    | 任务处理失败，可读取 `error_message` |

## 请求示例

```bash theme={null}
curl --request GET 'https://api.senseaudio.cn/v1/isolation/pending?task_id=9e4f0f7c-1c5c-4a1d-8a73-2d86d58c0d1b' \
  --header 'Authorization: Bearer <API_KEY>'
```


## OpenAPI

````yaml api-reference/endpoint/voice-isolation/voice-isolation.openapi.json GET /v1/isolation/pending
openapi: 3.1.0
info:
  title: SenseAudio - Voice Isolation
  version: 1.0.0
servers:
  - url: https://api.senseaudio.cn
    description: 生产环境
security:
  - bearerAuth: []
paths:
  /v1/isolation/pending:
    get:
      tags:
        - Voice Isolation
      summary: 查询人声分离任务
      description: 查询异步人声分离任务的处理状态与结果。
      operationId: voiceIsolationPending
      parameters:
        - name: task_id
          in: query
          required: true
          description: 异步任务 ID
          schema:
            type: string
          example: 9e4f0f7c-1c5c-4a1d-8a73-2d86d58c0d1b
      responses:
        '200':
          description: 查询成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceIsolationResult'
              examples:
                pending:
                  summary: 处理中
                  value:
                    source_file_name: sample.wav
                    result_url: ''
                    status: pending
                    error_message: ''
                completed:
                  summary: 处理成功
                  value:
                    source_file_name: sample.wav
                    result_url: https://xxx/voice-isolation/result.mp3
                    status: completed
                    error_message: ''
                failed:
                  summary: 处理失败
                  value:
                    source_file_name: sample.wav
                    result_url: ''
                    status: failed
                    error_message: voice isolation failed
        '400':
          description: 请求参数不符合要求
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    VoiceIsolationResult:
      type: object
      properties:
        source_file_name:
          type: string
          description: 原始上传文件名
          example: sample.wav
        result_url:
          type: string
          description: 分离结果音频 URL。任务成功时返回；任务处理中或失败时可能为空字符串。
          example: https://xxx/voice-isolation/result.mp3
        status:
          $ref: '#/components/schemas/VoiceIsolationStatus'
        error_message:
          type: string
          description: 错误信息。任务失败时返回失败原因，任务成功或处理中时通常为空字符串。
          example: ''
      required:
        - source_file_name
        - result_url
        - status
        - error_message
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: 错误码
        message:
          type: string
          description: 错误信息
    VoiceIsolationStatus:
      type: string
      description: 任务状态
      enum:
        - pending
        - completed
        - failed
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: 格式：`Bearer <API_KEY>`

````