asp.net core 项目,tts返回501
yjgyee 发布于2017-12 浏览:1807 回复:3
0
收藏
 public void Tts()
        {
            // 可选参数
            var option = new Dictionary
            {
                {"spd", 5}, // 语速
                {"vol", 7}, // 音量
                {"per", 4} // 发音人,4:情感度丫丫童声
            };
            var result = _ttsClient.Synthesis("众里寻他千百度", option);

            if (result.ErrorCode == 0) // 或 result.Success
                File.WriteAllBytes("合成的语音文件本地存储地址.mp3", result.Data);
        }

asp.net core项目,调用tts服务,上述代码中,result 返回以下错误

{"err_detail":"Content!","err_msg":"parameter error.","err_no":501,"err_subcode":50000,"tts_logid":1545101368}

收藏
点赞
0
个赞
共3条回复 最后由用户已被禁言回复于2022-04
#4goJhou回复于2017-12
#3 yjgyee回复
不是appkey与secretkey的问题,.net core下兼容性问题,查看.net corefx源代码 .net core GetRequestStream()使用同步调用方法调用异步方法InternalGetRequestStream(),导致参数传值问题
展开

ok 解决了就好。话说asp.net不能用c#的nuget包么

0
#3yjgyee回复于2017-12
#2 goJhou回复
请确认你的AK&SK 双钥准确无误 就是你的_ttsClient

不是appkey与secretkey的问题,.net core下兼容性问题,查看.net corefx源代码

.net core GetRequestStream()使用同步调用方法调用异步方法InternalGetRequestStream(),导致参数传值问题

0
#2goJhou回复于2017-12

请确认你的AK&SK 双钥准确无误 就是你的_ttsClient

2
TOP
切换版块