On March 1, 2021, Google Text-to-speech released beta features, including support for the ssml <voice> tag with name or lang attributes.
I'm hoping to use these beta features, but I can't figure out what channel they were released to or how to access them. I haven't found any breadcrumbs in the documentation that would lead me to them.
I noticed that on the TTS product home page, the demo feature uses v1beta1, but doesn't support the <voice> tag.
Screenshot of json from TTS demo stripping out the voice tag
That is, for the ssml:
<speak>
Blah Blah English Text. <voice name="ko-KR-Wavenet-D"> Blah Blah Korean Text.</voice> <break time="400ms" /> Blah Blah English Text.
</speak>
the demo shows the following json request body:
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 1
},
"input": {
"ssml": "<speak> Blah Blah English Text. Blah Blah Korean Text. <break time=\"400ms\" /> Blah Blah English Text. </speak>"
},
"voice": {
"languageCode": "en-US",
"name": "en-US-Wavenet-D"
}
}
What we've tried
In our own script using the google text-to-speech api to generate audio from a csv cue sheet, we've historically used the general release. The script still works when we change to v1beta1, but the <voice> tag still doesn't function. We're using the npm package symlinked to nodejs-text-to-speech master.
Our script uses:
const textToSpeech = require('@google-cloud/text-to-speech'); and
the general release const client = new textToSpeech.TextToSpeechClient();
We've been trying to access the March 1 beta features with
const client = new textToSpeech.v1beta1.TextToSpeechClient();