Dictionary data = new Dictionary();
data.Add("format", speechData.format);
data.Add("rate", speechData.rate);
data.Add("channel", speechData.channel);
data.Add("cuid", speechData.cuid);
data.Add("token", speechData.token);
data.Add("speech", speechData.speech);
string jsonDataPost = Json.Serialize(data);
Dictionary headers = new Dictionary();
headers.Add("Content-Type", "application/json");
byte[] body = System.Text.Encoding.UTF8.GetBytes(jsonDataPost);
WWW www = new WWW(speechUrl, body, headers);
yield return www;
Debug.Log(www.text);
返回值:{"err_msg":"parameters error.","err_no":3300,"sn":"858369483971459387237"}
收藏
点赞
0
个赞
请登录后评论
TOP
切换版块
Canvas_x:
Dictionary data = new Dictionary();
data.Add("format", speechData.format);
data.Add("rate", speechData.rate);
data.Add("channel", speechData.channel);
data.Add("cuid", speechData.cuid);
data.Add("token", speechData.token);
data.Add("speech", speechData.speech);
string jsonDataPost = Json.Serialize(data);
Dictionary headers = new Dictionary();
headers.Add("Content-Type", "application/json");
byte[] body = System.Text.Encoding.UTF8.GetBytes(jsonDataPost);
WWW www = new WWW(speechUrl, body, headers);
yield return www;
Debug.Log(www.text);
返回值:{"err_msg":"parameters error.","err_no":3300,"sn":"858369483971459387237"}
回复Canvas_x:请仔细核对文档及参照demo,核对输入参数
你没填len长度,
speechData.speech确保是base64没,不是2进制,而且一定要是能在播放器播放的speechData.format格式文件