package baidu type Token struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` ExpiresIn int `json:"expires_in"` Scope string `json:"scope"` SessionKey string `json:"session_key"` SessionSecret string `json:"session_secret"` } type AsrReq struct { Format string `json:"format"` //语音文件的格式,pcm/wav/amr/m4a。不区分大小写。推荐pcm文件 Rate int `json:"rate"` //采样率,16000、8000,固定值 Channel int `json:"channel"` //声道数,仅支持单声道,请填写固定值 1 Cuid string `json:"cuid"` //用户唯一标识,用来区分用户,计算UV值。建议填写能区分用户的机器 MAC 地址或 IMEI 码,长度为60字符以内。 Token string `json:"token"` //开放平台获取到的开发者[access_token]获取 Access Token "access_token") Speech string `json:"speech"` //本地语音文件的二进制语音数据 ,需要进行base64 编码。与len参数连一起使用。 Len int `json:"len"` //本地语音文件的的字节数,单位字节 } type AsrResp struct { CorpusNo string `json:"corpus_no"` ErrMsg string `json:"err_msg"` ErrNo int `json:"err_no"` Result []string `json:"result"` //识别结果 Sn string `json:"sn"` }