1

创建了一个 Bluemix 应用程序来获取正确的凭据,并使用 Fiddler Text to Speech(TTS) 来记录提示。录音使用默认的“Michael”语音。我想要艾莉森。

如果我尝试传入“voice”,我会收到以下错误,即使我指定“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"
}

我有开发者账号,需要注册才能使用“语音”吗?即使我传入默认的“迈克尔”?

4

1 回答 1

2

我认为您的问题在于您指定voice参数的方式。和参数可以作为 GET 中的查询参数发送
voicetext

例子

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

于 2015-10-27T18:10:36.677 回答