LAS语音转文字(Doubao-录音文件识别)增强版算子基于豆包录音文件识别大模型,能够将输入音频/视频文件中的语音,转写为文本输出。支持多种音/视频格式、多语种、音频降噪及大文件处理,适用于内容质检审核、音视频字幕生成、语音搜索、课堂内容分析等场景。
提交音频链接,并获取服务端分配的任务 ID。
参数 | 类型 | 是否必填 | 示例值 | 描述 |
|---|---|---|---|---|
operator_id | string | 是 | las_asr_pro | 算子Id |
operator_version | string | 是 | v1 | 算子版本 |
data | SpeechRecognition | 是 | 请求数据 |
参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
metadata | Metadata | 请求元信息 |
curl --location "https://operator.las.cn-beijing.volces.com/api/v1/submit" \ --header "Content-Type: application/json" \ --header "Authorization: $LAS_API_KEY" \ --data ' { "operator_id": "las_asr_pro", "operator_version": "v1", "data": { "resource": "bigasr", "audio": { "url": "https://las-ai-cn-beijing-online.tos-cn-beijing.volces.com/operator_cards_serving/public/online/las_asr/badaling.wav", "format": "wav" }, "request": { "model_name": "bigmodel" } } }'
{ "metadata": { "task_id": "xxxxx123ef24ea40546c", "task_status": "PENDING", "business_code": "0", "error_msg": "", "request_id": "494022a8a0fc3eadb758cf8b0e8b20ef" } }
通过任务 ID 查询录音转写结果。
参数 | 类型 | 必填 | 示例值 | 说明 |
|---|---|---|---|---|
operator_id | string | 是 | las_asr_pro | 算子Id |
operator_version | string | 是 | v1 | 算子版本 |
task_id | string | 是 | 异步任务Id |
参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
metadata | Metadata | 请求的元信息,异步任务的id在其中的task_id字段下。 | |
data | AudioResponse | 返回的音频识别结果。 |
curl --location "https://operator.las.cn-beijing.volces.com/api/v1/poll" \ --header "Content-Type: application/json" \ --header "Authorization: $LAS_API_KEY" \ --data ' { "operator_id": "las_asr_pro", "operator_version": "v1", "task_id": "xxxxx123ef24ea40546c" }'
{ "metadata": { "task_id": "xxxxx123ef24ea40546c", "task_status": "COMPLETED", "business_code": "0", "error_msg": "", "request_id": "d204c21f5c7c8f8cfeb85d211b9c20ac" }, "data": { "audio_info": { "duration": 3575 }, "result": { "additions": { "duration": "3575" }, "text": "参观达*长城。", "utterances": [ { "additions": { "channel_id": "1" }, "end_time": 2320, "start_time": 640, "text": "参观达*长城。", "words": [ { "confidence": 0, "end_time": 920, "start_time": 640, "text": "参" }, { "confidence": 0, "end_time": 1120, "start_time": 920, "text": "观" }, { "confidence": 0, "end_time": 1480, "start_time": 1440, "text": "达" }, { "confidence": 0, "end_time": 1720, "start_time": 1680, "text": "*" }, { "confidence": 0, "end_time": 2080, "start_time": 1880, "text": "长" }, { "confidence": 0, "end_time": 2320, "start_time": 2080, "text": "城" } ] } ] } } }