Microsoft认知服务语音服务文本到语音REST API调用 [英] Microsoft Cognitive Services Speech Service Text to Speech REST API Call

查看:133
本文介绍了Microsoft认知服务语音服务文本到语音REST API调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此呼叫(URI-https://westus.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1) throwing error 'HTTP/1/1 400 Data at the root level is not valid. Line 1 Position 1.'.

This call (URI - https://westus.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1) throwing error 'HTTP/1/1 400 Data at the root level is not valid. Line 1 Position 1.'.

传递给http POST方法的标头值很好.对于以下内容,将引发错误消息:

The header values being passed to the http POST method are fine.  The error message is thrown for the following content:

< speak version =" 1.0" xmlns =" http://www.w3.org/2001/10/synthesis " xml:lang ="zh-CN">
 < voice xml:lang ="zh-CN" xml:gender =女性" name ="Microsoft服务器语音文本到语音语音(英语,ZiraRUS)"                                    你是? </voice> </speak>

<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">
 <voice xml:lang="en-US" xml:gender="Female" name="Microsoft Server Speech Text to Speech Voice (en-US, ZiraRUS)">                            How are you? </voice> </speak>

要测试我是否将内容传递为空白,则显示的消息为"HTTP/1/1 400ssml不能为空或为空".

For testing if I pass the Content as blank, then the message shown is ''HTTP/1/1 400 ssml cannot be emty or null'.

That means, this call is expecting the SSML, but when passed throws the above mention error.

I'd appreciate any help.

谢谢

推荐答案

请确保内容前没有空格.这会导致错误.

Please make sure there is no space before the content. It would cause the error.

此致

雨桐


这篇关于Microsoft认知服务语音服务文本到语音REST API调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆