讯飞api
首页
首页
  1. 录音文件识别
  • 基本介绍
  • 快速开始
    • 开发必读
    • 接口调用
    • 获取token令牌
      POST
  • 音频转写
    • 实时语音转写
    • 语音文件异步转写
      POST
    • 异步接收转写结果
      POST
  • 语音听写
    • 开启会话
      POST
    • 音频写入
      POST
    • 获取结果
      POST
    • 结束会话
      POST
  • 录音文件识别
    • 调用说明
    • 提交任务
      POST
    • 查询识别结果
      POST
  • ocr识别
    • 获取图像OCR结果
      POST
  • 附录
    • 附录1:错误码枚举
  1. 录音文件识别

查询识别结果

POST
/fileAsr/searchResults
先调用“提交任务”结果获取任务id,再轮询调用此接口查询结果。如果返回SUCCEEDED或者FAILED停止轮询。
识别结果字段说明:
参数类型说明
audio_formatstring源文件中音频的格式。
channelsList[int]源文件中音频的音轨索引信息,对单轨音频返回[0],对双轨音频返回[0, 1],以此类推。
original_sampling_rateint源文件中的原始音频时长(ms)。
content_durationint音轨中被判定为语音内容的时长(ms)。
transcriptstring段落级别的语音转写结果。
sentencesList[]句子级别的语音转写结果。
wordsList[]源文件中音频的格式。
begin_timeint开始时间戳(ms)。
end_timeint结束时间戳(ms)。
textstring语音转写结果。
punctuationstring预测出的词之后的标点符号(如有)。

请求参数

Body 参数application/json

示例
{
    "taskId": "string"
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/fileAsr/searchResults' \
--header 'Content-Type: application/json' \
--data-raw '{
    "taskId": "string"
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "code": "200",
    "msg": "调用成功",
    "data": {
        "status": "SUCCEEDED",
        "subResults": [
            {
                "status": "SUCCEEDED",
                "message": null,
                "transcriptionBody": {
                    "file_url": "https://dashscope.oss-cn-beijing.aliyuncs.com/samples/audio/paraformer/hello_world_female2.wav",
                    "transcripts": [
                        {
                            "sentences": [
                                {
                                    "sentence_id": 1,
                                    "end_time": 3820,
                                    "words": [
                                        {
                                            "end_time": 596,
                                            "punctuation": "",
                                            "begin_time": 100,
                                            "text": "Hello "
                                        },
                                        {
                                            "end_time": 844,
                                            "punctuation": ", ",
                                            "begin_time": 596,
                                            "text": "world"
                                        },
                                        {
                                            "end_time": 1092,
                                            "punctuation": "",
                                            "begin_time": 844,
                                            "text": "这"
                                        },
                                        {
                                            "end_time": 1340,
                                            "punctuation": "",
                                            "begin_time": 1092,
                                            "text": "里"
                                        },
                                        {
                                            "end_time": 1588,
                                            "punctuation": "",
                                            "begin_time": 1340,
                                            "text": "是"
                                        },
                                        {
                                            "end_time": 1836,
                                            "punctuation": "",
                                            "begin_time": 1588,
                                            "text": "阿"
                                        },
                                        {
                                            "end_time": 2084,
                                            "punctuation": "",
                                            "begin_time": 1836,
                                            "text": "里"
                                        },
                                        {
                                            "end_time": 2332,
                                            "punctuation": "",
                                            "begin_time": 2084,
                                            "text": "巴"
                                        },
                                        {
                                            "end_time": 2580,
                                            "punctuation": "",
                                            "begin_time": 2332,
                                            "text": "巴"
                                        },
                                        {
                                            "end_time": 2828,
                                            "punctuation": "",
                                            "begin_time": 2580,
                                            "text": "语"
                                        },
                                        {
                                            "end_time": 3076,
                                            "punctuation": "",
                                            "begin_time": 2828,
                                            "text": "音"
                                        },
                                        {
                                            "end_time": 3324,
                                            "punctuation": "",
                                            "begin_time": 3076,
                                            "text": "实"
                                        },
                                        {
                                            "end_time": 3572,
                                            "punctuation": "",
                                            "begin_time": 3324,
                                            "text": "验"
                                        },
                                        {
                                            "end_time": 3820,
                                            "punctuation": "。",
                                            "begin_time": 3572,
                                            "text": "室"
                                        }
                                    ],
                                    "begin_time": 100,
                                    "text": "Hello world, 这里是阿里巴巴语音实验室。"
                                }
                            ],
                            "content_duration_in_milliseconds": 3720,
                            "text": "Hello world, 这里是阿里巴巴语音实验室。",
                            "channel_id": 0
                        }
                    ],
                    "properties": {
                        "channels": [
                            0
                        ],
                        "audio_format": "pcm_s16le",
                        "original_sampling_rate": 16000,
                        "original_duration_in_milliseconds": 3834
                    }
                }
            },
            {
                "status": "SUCCEEDED",
                "message": null,
                "transcriptionBody": {
                    "file_url": "https://dashscope.oss-cn-beijing.aliyuncs.com/samples/audio/paraformer/hello_world_male2.wav",
                    "transcripts": [
                        {
                            "sentences": [
                                {
                                    "sentence_id": 1,
                                    "end_time": 4720,
                                    "words": [
                                        {
                                            "end_time": 629,
                                            "punctuation": "",
                                            "begin_time": 0,
                                            "text": "Hello "
                                        },
                                        {
                                            "end_time": 944,
                                            "punctuation": ", ",
                                            "begin_time": 629,
                                            "text": "world"
                                        },
                                        {
                                            "end_time": 1258,
                                            "punctuation": "",
                                            "begin_time": 944,
                                            "text": "这"
                                        },
                                        {
                                            "end_time": 1573,
                                            "punctuation": "",
                                            "begin_time": 1258,
                                            "text": "里"
                                        },
                                        {
                                            "end_time": 1888,
                                            "punctuation": "",
                                            "begin_time": 1573,
                                            "text": "是"
                                        },
                                        {
                                            "end_time": 2202,
                                            "punctuation": "",
                                            "begin_time": 1888,
                                            "text": "阿"
                                        },
                                        {
                                            "end_time": 2517,
                                            "punctuation": "",
                                            "begin_time": 2202,
                                            "text": "里"
                                        },
                                        {
                                            "end_time": 2832,
                                            "punctuation": "",
                                            "begin_time": 2517,
                                            "text": "巴"
                                        },
                                        {
                                            "end_time": 3146,
                                            "punctuation": "",
                                            "begin_time": 2832,
                                            "text": "巴"
                                        },
                                        {
                                            "end_time": 3461,
                                            "punctuation": "",
                                            "begin_time": 3146,
                                            "text": "语"
                                        },
                                        {
                                            "end_time": 3776,
                                            "punctuation": "",
                                            "begin_time": 3461,
                                            "text": "音"
                                        },
                                        {
                                            "end_time": 4090,
                                            "punctuation": "",
                                            "begin_time": 3776,
                                            "text": "实"
                                        },
                                        {
                                            "end_time": 4405,
                                            "punctuation": "",
                                            "begin_time": 4090,
                                            "text": "验"
                                        },
                                        {
                                            "end_time": 4720,
                                            "punctuation": "。",
                                            "begin_time": 4405,
                                            "text": "室"
                                        }
                                    ],
                                    "begin_time": 0,
                                    "text": "Hello world, 这里是阿里巴巴语音实验室。"
                                }
                            ],
                            "content_duration_in_milliseconds": 4720,
                            "text": "Hello world, 这里是阿里巴巴语音实验室。",
                            "channel_id": 0
                        }
                    ],
                    "properties": {
                        "channels": [
                            0
                        ],
                        "audio_format": "pcm_s16le",
                        "original_sampling_rate": 16000,
                        "original_duration_in_milliseconds": 4726
                    }
                }
            }
        ]
    },
    "traceId": "ed7d95599b9a04f5"
}
修改于 2025-02-21 10:42:08
上一页
提交任务
下一页
获取图像OCR结果
Built with