[英]Watson TTS doesn't allow to choose voice
创建了一个Bluemix应用程序以获取正确的凭据,并使用Fiddler文本语音转换(TTS)来记录提示。 录音使用默认的“ Michael”声音。 我要艾莉森。
如果我尝试传递“语音”,即使我将“ Michael”指定为选择,也会出现以下错误:
{
"code_description": "Bad request",
"code": 400,
"error": "The argument(s) [u'voice'} are not allowed."
}
这是我的有效载荷:
{
"text": "Hello,, this is Dora. How are you today?",
"voice": "en-US_AllisonVoice"
}
我有一个开发人员帐户,需要注册才能使用“语音”吗? 即使我传入默认的“ Michael”?
我认为您的问题在于您指定voice
参数的方式。
voice
和text
参数可以作为查询参数发送到GET中。
1.卷曲
curl -u "{username}":"{password}" "https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?voice=en-US_AllisonVoice&text=Hello%2C%20this%20is%20Dora.%20How%20are%20you%20today%3F"
节点
var watson = require('watson-developer-cloud');
var fs = require('fs');
var text_to_speech = watson.text_to_speech({
username: '<username>',
password: '<password>',
version: 'v1'
});
var params = {
text: 'Hello, this is Dora. How are you today?',
voice: 'en-US_AllisonVoice',
accept: 'audio/wav'
};
// Pipe the synthesized text to a file
text_to_speech.synthesize(params).pipe(fs.createWriteStream('output.wav'));
有关如何调用服务的更多示例,请参见Text to Speech API参考 。
在此处尝试上面的示例:
https://text-to-speech-demo.mybluemix.net/api/synthesize?voice=en-US_AllisonVoice&text=Hello%2C%20this%20is%20Dora.%20How%20are%20you%20today%3F
由演示应用程序提供动力: https : //text-to-speech-demo.mybluemix.net
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.