REST API合成错误
redhobor 发布于2016-07 浏览:2298 回复:9
0
收藏
快速回复

请求的URL格式如下:

"http://tsn.baidu.com/text2audio?tex=" + URLEncoder.encode(URLEncoder.encode(text, "UTF-8"), "UTF-8") + "&lan=" + URLEncoder.encode(URLEncoder.encode("en", "UTF-8"), "UTF-8") + "&cuid=" + URLEncoder.encode(URLEncoder.encode(cuid, "UTF-8"), "UTF-8") + "&ctp=1" + "&tok=" + URLEncoder.encode(URLEncoder.encode(access_token, "UTF-8"), "UTF-8")

在浏览器打开后,显示结果为:

{"err_msg":"backend error.","err_no":503}



收藏
点赞
0
个赞
共9条回复 最后由用户已被禁言回复于2022-04
#10mosal4hi回复于2016-08

恩,目前这块开放确实支持不好。

0
#9redhobor回复于2016-08

上次回答还说支持的,现在变成了没开放。。

BTW,感谢您的关注和回复。

0
#8mosal4hi回复于2016-08

确认了下,目前还没开放全英文的合成

0
#7redhobor回复于2016-07

文本如下:

That was the provocative question posed in a blog on the eve of BETT by the General Secretary of the National Association of Head Teachers. According to one newspaper headline Russell Hobby said "money spent by schools on fad iPads could have funded 8,000 teachers". Another translated it as "Schools should stop wasting money buying iPads and 'shiny gadgets' for pupils."


当读8,000时,就变成中文读法八千了。

0
#6mosal4hi回复于2016-07

请提供下完整文本

0
#5redhobor回复于2016-07

还是有点问题,参数值=zh,文本中的数字在合成后发音都变成中文的了。

能否帮忙看下纯英文语音合成rest api参数lan值是多少?

0
#4mosal4hi回复于2016-07

总结的不错,解决就好。

0
#3redhobor回复于2016-07

已经调试通过。结果发现: 

1) lan参数值只能为"zh",否则503合成错误。我做的是全英文合成,但参数值也必须写成"zh",之前一直在这个坑里:(

2)官方文档要求“参数都需要经过两次 URLENCODE 操作”,但我测试发现除了tex需要URLEncoder,其他参数实际上并不需要。

0
#2mosal4hi回复于2016-07

这个为啥这样encode,拼接完再encode试试呢?

0
TOP
切换版块