Submit a recording for asynchronous annotation. Retrieve time-aligned speech, sound effects, and background sounds, along with a description of the recording as a whole.
The examples use China (Beijing). Set
WORKSPACE_ID to your workspace ID and DASHSCOPE_API_KEY to your API key for this region.Submit a task
Submit an audio or video file to create an asynchronous annotation task.
POST
https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/asr/transcriptionRequest headers
AuthorizationstringRequiredBearer $DASHSCOPE_API_KEY.Content-TypestringRequiredapplication/jsonX-DashScope-AsyncstringRequiredenable to process the file asynchronously.Request body
modelstringRequiredqwen-audio-3.1-captioner.inputobjectRequiredfile_urlstringRequiredparametersobjectOptionalchannel_idarray[integer]Optional[0] for a mono recording, or specify multiple indices for a multichannel file.Response fields
outputobjecttask_idstringtask_statusstringrequest_idstringSubmit
Submission
Query a task
Query the processing status by task ID. When the task succeeds, the response includes the download URL for the annotations.
GET
https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}Path parameter
task_idstringRequiredResponse fields
request_idstringoutputobjecttask_idstringtask_statusstringPENDING: Queued. Poll again later.RUNNING: Processing. Poll again later.SUCCEEDED: The task succeeded. Check the file status and download the result.FAILED: The task failed.CANCELED: The task was canceled.
submit_timestringscheduled_timestringend_timestringfile_urlstringsubtask_statusstringSUCCEEDED means the annotation file is ready.transcription_urlstringQuery
Successful
Download and parse the result
After the task succeeds, download the result file. It contains input audio metadata, annotations for each channel, and token usage.
Result file
file_urlstringpropertiesobjectaudio_formatstringpcm_s16le.channelsarray[integer]original_sampling_rateintegeroriginal_duration_in_millisecondsintegertranscriptsarray[object]channel_idintegercontent_duration_in_millisecondsintegertextstringsentencesarray[object]begin_timeintegerend_timeintegertextstringspeaker_idintegerusageobjectinput_tokensintegeroutput_tokensintegertotal_tokensintegerAnnotations
Parse transcripts[].text in the result file to read the following fields.sound_segmentsarray[object]start_timestringMM:SS.cc (minutes:seconds.centiseconds). It can be negative if the event began in an earlier segment.end_timestringMM:SS.cc.tagarray[string]descriptionstringspeech_segmentsarray[object]startstringMM:SS.cc (minutes:seconds.centiseconds). It can be negative if the event began in an earlier segment.endstringMM:SS.cc.languagearray[string]textstringparaobjectspeech_modestring唱歌(singing)说唱(rapping)朗诵(recitation)播报(announcement)解说(commentary)讲解(explanation)演讲(speech)讲故事(storytelling)访谈(interview)闲聊(conversation)独白(monologue)无人声(no speech)
speedstring极慢(very slow)偏慢(slow)中速(moderate)偏快(fast)极快(very fast)短促(clipped)
volumestring轻声(soft)中等(moderate)偏大(loud)高亢(projected)
intonationstringspeakerarray[string]speaker_indexarray[string]background_segmentsarray[object]start_timestringMM:SS.cc (minutes:seconds.centiseconds). It can be negative if the event began in an earlier segment.end_timestringMM:SS.cc.descriptionarray[string]speech_globalsobjectspeakersarray[object]speaker_indexstringSPK_0.rolestringgenderstringagestringnamestringdescriptionstringvoiceobjectnaturearray[string]texturearray[string]globalobjectsceneobjectdescriptionstringformatarray[string]topicarray[string]stylearray[string]emotionobjectoverallarray[string]flowarray[array[string]]Download
Read
Parsed