I am using the US region for Text-to-Speech. have used a Wavenet voice for several hundred voice lines we use for a website, but recently I am unable to see any Wavenet voice options available. Under US-EN, I can now only see Chirp3 voices. Is there a way to still access Wavenet? It would be quite difficult to go back and replace all the audios we have produced with a new voice. Thank you!
Solved! Go to Solution.
Hi OFox108,
Welcome to the Google Cloud Community!
Instead of using the console method, you can try the Cloud Shell method. I tried replicating the issue and successfully generated audio in a Wavenet voice using the Cloud Shell terminal with the parameters languageCode: "en-US" and name: "en-US-Wavenet-A".
curl -X POST -H "Content-Type: application/json" \
-H "X-Goog-User-Project: $(gcloud config list --format='value(core.project)')" \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
--data '{
"input": {
"text": "The cat sat on the mat, She is happy, He runs fast, and We eat lunch"
},
"voice": {
"languageCode": "en-US",
"name": "en-US-Wavenet-A"
},
"audioConfig": {
"audioEncoding": "MP3"
}
}' "https://texttospeech.googleapis.com/v1/text:synthesize" > synthesize-text.txt
cat synthesize-text.txt | grep 'audioContent' | \
sed 's|audioContent| |' | tr -d '\n ":{},' > tmp.txt && \
base64 tmp.txt --decode > synthesize-text-audio.mp3 && \
rm tmp.txt
You can also follow these steps to convert text to synthetic voice audio, including how to decode the results from the Text-to-Speech API.
Additionally, you can refer to this documentation on supported voices and languages.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Hi OFox108,
Welcome to the Google Cloud Community!
Instead of using the console method, you can try the Cloud Shell method. I tried replicating the issue and successfully generated audio in a Wavenet voice using the Cloud Shell terminal with the parameters languageCode: "en-US" and name: "en-US-Wavenet-A".
curl -X POST -H "Content-Type: application/json" \
-H "X-Goog-User-Project: $(gcloud config list --format='value(core.project)')" \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
--data '{
"input": {
"text": "The cat sat on the mat, She is happy, He runs fast, and We eat lunch"
},
"voice": {
"languageCode": "en-US",
"name": "en-US-Wavenet-A"
},
"audioConfig": {
"audioEncoding": "MP3"
}
}' "https://texttospeech.googleapis.com/v1/text:synthesize" > synthesize-text.txt
cat synthesize-text.txt | grep 'audioContent' | \
sed 's|audioContent| |' | tr -d '\n ":{},' > tmp.txt && \
base64 tmp.txt --decode > synthesize-text-audio.mp3 && \
rm tmp.txt
You can also follow these steps to convert text to synthetic voice audio, including how to decode the results from the Text-to-Speech API.
Additionally, you can refer to this documentation on supported voices and languages.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
This worked for me as well, thank you!
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |