Speaker Diarization

Identify different speakers in audio, return a speaker timeline structure, and optionally generate separate audio files for each detected speaker.

Create Task

Basic Information

ItemValue
Request MethodPOST
Request Path/task/audio_speaker_split
Content-Typeapplication/json
AuthenticationRaw API key in the Authorization header

Request Body

ParameterTypeRequiredDefaultDescription
file_idstringYes-Uploaded audio or video file ID
only_structbooleanNotruetrue: return speaker structure only. false: also generate separated audio files
keep_origin_lengthbooleanNofalseWhether generated files should preserve the original duration with silence padding

Request Example

curl -X POST https://api.ai-mcn.tv:10000/task/audio_speaker_split \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_id": "537489015178246",
    "only_struct": false,
    "keep_origin_length": false
  }'

Success Example

{
  "code": 200,
  "msg": "success",
  "data": {
    "task_id": "537489015178247",
    "task_type": "audio_speaker_split",
    "status": "queued"
  }
}

Query Task Result

Basic Information

ItemValue
Request MethodGET
Request Path/task/audio_speaker_split/{task_id}
AuthenticationRaw API key in the Authorization header

Output Result (output_result)

ParameterTypeDescription
spoken_listarraySpeaker segment list
spoken_list[].speakerstringSpeaker identifier, such as "SPEAKER_01"
spoken_list[].start_timenumberSegment start time in seconds
spoken_list[].end_timenumberSegment end time in seconds
filesarraySeparated audio files, returned only when only_struct: false
files[].speakerstringSpeaker identifier
files[].file_idstringGenerated speaker file ID
files[].download_urlstringDownload path for the generated file

Success Example

{
  "code": 200,
  "msg": "success",
  "data": {
    "task_id": "537489015178247",
    "status": "completed",
    "progress": 100,
    "output_result": {
      "spoken_list": [
        { "speaker": "SPEAKER_01", "start_time": 0.0, "end_time": 5.2 },
        { "speaker": "SPEAKER_02", "start_time": 5.5, "end_time": 12.8 },
        { "speaker": "SPEAKER_01", "start_time": 13.0, "end_time": 18.6 }
      ],
      "files": [
        {
          "speaker": "SPEAKER_01",
          "file_id": "537489015178248",
          "download_url": "/download/a1/speaker_01.wav"
        },
        {
          "speaker": "SPEAKER_02",
          "file_id": "537489015178249",
          "download_url": "/download/a1/speaker_02.wav"
        }
      ]
    },
    "create_time": "2026-04-05T08:00:00Z",
    "update_time": "2026-04-05T08:00:20Z"
  }
}

Error Codes

Error CodeHTTP StatusDescriptionResolution
6013400Missing file_idPass the file_id field
6004404File not foundVerify the file_id
6502401Authentication failedCheck the Authorization header
6202402Insufficient balanceRecharge in the Dashboard