调用该接口查询语料详情,包括语料的播报声音、语料类型和音量大小等。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

请求参数

名称类型是否必选示例值描述
名称 类型 是否必选 示例值 描述
Action String QuerySpeech

系统规定参数。取值:QuerySpeech。

SpeechCode String 4de2c367****8c585e5992**

语料ID,调用CreateSpeech成功后返回的Data字段为语料ID。

IotInstanceId String iot_instc_pu****_c*-v64********

实例ID。

必须传入实例ID,否则调用会失败。您可在物联网平台控制台的实例概览页面,查看您的实例ID。

重要

如果公共实例没有ID,请参见如何获取实例ID

调用API时,除了本文介绍的该API的特有请求参数,还需传入公共请求参数。公共请求参数说明,请参见公共参数文档

返回数据

名称类型示例值描述
名称 类型 示例值 描述
Code String iot.speechsolution.NotSigned

调用失败时,返回的错误码。更多信息,请参见错误码

Data Struct

语料详情。

AudioFormat String wav

音频格式,仅支持wavmp3amr格式。

BizCode String identifying

语料标识,当设备调用多个语料进行组合播报时,通过该标识播报指定的语料。

EnableSoundCode Boolean true

是否启用声码。

SoundCodeConfig Struct

声码配置。

AdditionalDuration Integer 3

语料播放结束后的声码播放时长,单位为秒,取值范围为1~15。

SoundCodeContent String www.taobao.com

声码营销内容,例如商品的详情地址等。

SpeechCode String 4de2c367****8c585e5992**

语料ID。

SpeechRate Integer 0

播报速度。

SpeechType String custom

语料类型,分为自定义语料和常用语料。

Text String test

语料内容。

Voice String Siyue

语料播报声音。

Volume Integer 50

音量大小。

ErrorMessage String speech solution has not been signed

调用失败时,返回的出错信息。

RequestId String 66FF51D3-***-49F1-B1A2-***

阿里云为该请求生成的唯一标识符。

Success Boolean true

是否调用成功。

  • true:调用成功。
  • false:调用失败。

示例

请求示例

http(s)://iot.cn-shanghai.aliyuncs.com/?Action=QuerySpeech
&SpeechCode=4de2c367****8c585e5992** 
&<公共请求参数>

正常返回示例

XML格式

<RequestId>66FF51D3-***-49F1-B1A2-***</RequestId>
<Data>
    <SpeechType>custom</SpeechType>
    <Volume>50</Volume>
    <EnableSoundCode>true</EnableSoundCode>
    <Text>test</Text>
    <SpeechCode>4de2c367****8c585e5992** </SpeechCode>
    <AudioFormat>wav</AudioFormat>
    <Voice>Siyue</Voice>
    <SpeechRate>0</SpeechRate>
    <BizCode>identifying</BizCode>
    <SoundCodeConfig>
        <AdditionalDuration>3</AdditionalDuration>
        <SoundCodeContent>www.taobao.com</SoundCodeContent>
    </SoundCodeConfig>
</Data>
<ErrorMessage>speech solution has not been signed</ErrorMessage>
<Code>iot.speechsolution.NotSigned</Code>
<Success>true</Success>

JSON格式

{"RequestId":"66FF51D3-***-49F1-B1A2-***","Data":{"SpeechType":"custom","Volume":"50","EnableSoundCode":"true","Text":"test","SpeechCode":"4de2c367****8c585e5992** ","AudioFormat":"wav","Voice":"Siyue","SpeechRate":"0","BizCode":"identifying","SoundCodeConfig":{"AdditionalDuration":"3","SoundCodeContent":"www.taobao.com"}},"ErrorMessage":"speech solution has not been signed","Code":"iot.speechsolution.NotSigned","Success":"true"}