Reputation: 11
Created a Bluemix app to get the proper credentials and using Fiddler Text to Speech(TTS) to record prompts. Recordings use the default "Michael" voice. I want Allison.
If I try passing in "voice", I get the following error, even when I specify "Michael" as my choice:
{
"code_description": "Bad request",
"code": 400,
"error": "The argument(s) [u'voice'} are not allowed."
}
This is my payload:
{
"text": "Hello,, this is Dora. How are you today?",
"voice": "en-US_AllisonVoice"
}
I have a developer account, do I need to sign up to use "voice"? Even if I pass in the default "Michael"?
Upvotes: 1
Views: 710
Reputation: 23653
I think your problem is in the way you are specifing the voice
parameter.
The voice
and text
parameters can be send as query parameters in a GET.
1. Curl
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"
Node
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'));
See the Text to Speech API Reference for more examples on how to call the service.
Try the example above here:
https://text-to-speech-demo.mybluemix.net/api/synthesize?voice=en-US_AllisonVoice&text=Hello%2C%20this%20is%20Dora.%20How%20are%20you%20today%3F
Powered by the demo app: https://text-to-speech-demo.mybluemix.net
Upvotes: 2