简体   繁体   中英

Watson TTS voice selection

I'm trying to use Watson TTS service, I cannot manage to change the default "Michael" voice. Following the documentation I wrote this request:

curl -X POST -u "my_usr":"my_pwd" \
--header "Content-Type: application/json" \
--header "Accept: audio/wav" \
--data '{"text": "foo", "voice": "es-LA_SofiaVoice"}' \
--output "foo.wav" \
"https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize"

Unfortunately I still get the default male I managed to get it to work using the GET request and adding ?voice="my_voice" in the url but I'd prefer to use the POST request, what am I doing wrong?

The API documentation for the POST shows the voice setting being sent in the same way as the GET

https://www.ibm.com/watson/developercloud/text-to-speech/api/v1/curl.html?curl#synthesize

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM