AMarie Lab
AMarie Lab

Reputation: 1

SSML code in Curl text to speech IBM Watson

I am trying to use IBM Watson Text to Speech because I need to get some audio file to insert in a video but I am not a developer, at all! Looking a the scarce tutorial provided on IBM cloud website, I figured out how to get the audio file using curl. But I cannot find a way to use the SSML possibilities to modify the voice. I don't understand where we have to specify the tags in the code. Here is the code I use, it works to produce the audio file. Where should I insert the tags to customize the voice?... Any help would be more than welcome! Many thanks in advance

curl -X POST -u "credential OK":"credential ok" \        
--header "Content-Type: application/json" \        
--header "Accept: audio/mp3" \        
--data '{"text": "The visceral leishmaniasis, also known as kala-azar is characterized by irregular bouts of fever, substantial weight loss, swelling of the spleen and liver, and anaemia. Visceral leishmaniasis is fatal in over 95% of cases if left untreated."}' \        
--output Essai.mp3 \        
"https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?voice=en-US_AllisonVoice"\   

Upvotes: 0

Views: 780

Answers (2)

skrantz
skrantz

Reputation: 39

I know this answer is late in coming but it might help someone else with the same problem.

--data "{\"text\": \"<voice-transformation type='Custom' breathiness='35%' pitch='-80%' pitch_range='60%' glottal_tension='-40%' ><p><s>The visceral leishmaniasis, <break strength='500ms'></break>also known as kala-azar, <break strength='500ms'></break> <express-as type='Uncertainty'>is characterized by irregular bouts of fever, substantial weight loss, swelling of the spleen and liver, and anaemia.</express-as></s> <s>Visceral leishmaniasis is fatal in over 95% of cases if left untreated.</s></p></voice-transformation>\"}" \

I believe the reason that the example provided by chughts did not work, may be because of improper escaping of quotes in the JASON object. *Also please note that the the express-as element only works with the en-US_AllisonVoice.

Personally I can't tell the difference in the voice using any of the express-as element type options. FWIW, I much prefer the en-US_LisaV3Voice, but you can't use voice-transformations with the V3 voices.

Upvotes: -1

chughts
chughts

Reputation: 4737

You put the SSML tags round the text that it need to be applied to

eg. for your example

--data '{"text": "<express-as type='GoodNews'> The visceral leishmaniasis, also known as kala-azar </express-as> is characterized by irregular bouts of fever, substantial weight loss, swelling of the spleen and liver, and anaemia. Visceral leishmaniasis is fatal in over 95% of cases if left untreated."}'

Upvotes: 0

Related Questions