Skip to content

语音包模块

透传:获取语音列表

  1. 请求链接: /passthrough

  2. 请求方式: POST

  3. 参数说明:

名称类型是否必需示例描述
request_methodStringY"POST"POST/GET
request_uriStringY"/api/v1/voice/packs"云平台透传API地址
post_argsobjectY透传参数,参数请根据当前锁信息获取
  1. 返回参数及示例:
参数类型描述
statusInt状态码
statusTextString提示信息
contentString返回数据
errorCodeInt错误码
errorMsgString错误信息
descriptionString描述
dataArray返回数据
langString语言代码
timbresArray音色列表
isFemaleInt0:男声 1:女声
timbreString音色标识
nameString音色名称
timbrePackUrlString语音包URL
json
{
  "errorCode": 0,
  "errorMsg": "none error message",
  "description": "",
  "data": [
    {
      "lang": "zh_CN",
      "timbres": [
        {
          "isFemale": 0,
          "timbre": "xiaoyun",
          "name": "默认音色",
          "timbrePackUrl": "https://company.dev.star-lock.cn/storage/voice/4/dir_story"
        },
        {
          "timbre": "xiaogang",
          "name": "普通话男声",
          "timbrePackUrl": "https://company.dev.star-lock.cn/storage/voice/5/dir_story"
        },
        {
          "timbre": "zhixiaomei",
          "name": "普通话女声",
          "timbrePackUrl": "https://company.dev.star-lock.cn/storage/voice/6/dir_story"
        }
      ]
    },
    {
      "lang": "en_US",
      "timbres": [
        {
          "timbre": "xiaoyun",
          "name": "默认音色",
          "timbrePackUrl": "https://company.dev.star-lock.cn/storage/voice/7/dir_story"
        },
        {
          "timbre": "harry",
          "name": "英音男声",
          "timbrePackUrl": "https://company.dev.star-lock.cn/storage/voice/8/dir_story"
        },
        {
          "timbre": "emily",
          "name": "英音女声",
          "timbrePackUrl": "https://company.dev.star-lock.cn/storage/voice/9/dir_story"
        }
      ]
    }
  ]
}

设置语音

  1. 请求链接: /lockSetting/updateLockSetting

  2. 请求方式: POST

  3. 参数说明:

名称类型是否必需示例描述
lockIdintY1001锁ID
currentVoiceTimbreobjectY当前选择的语音

currentVoiceTimbre 格式说明:

  • lang: 语言代码(如:zh_CN、en_US)
  • timbre: 音色标识(如:xiaoyun、xiaogang、zhixiaomei)
json
{
  "currentVoiceTimbre": {
    "lang": "zh_CN",
    "timbre": "xiaoyun"
  }
}
  1. 返回参数及示例:
参数类型描述
statusInt状态码
statusTextString提示信息
contentString返回数据
errorCodeInt错误码
descriptionString描述
errorMsgString错误信息
json
{
  "errorCode": 0,
  "description": "表示成功或是。",
  "errorMsg": "success or means yes"
}

鑫泓佳智能硬件通信协议文档