创建一个Bluemix应用程序以获取正确的凭据并使用Fiddler Text to Speech(TTS)来记录提示。录音使用默认的" Michael"语音。我想要Allison。
如果我尝试传入"语音",即使我指定" 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"
}
我有一个开发者帐户,我是否需要注册才能使用"语音"?即使我传入默认的"迈克尔"?
答案 0 :(得分:2)
我认为您的问题与指定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'));
有关如何调用服务的更多示例,请参阅文字转语音API Reference 试试上面的例子:
https://text-to-speech-demo.mybluemix.net/api/synthesize?voice=en-US_AllisonVoice&text=Hello%2C%20this%20is%20Dora.%20How%20are%20you%20today%3F