actions-on-googlessml

google actions sdk: dynamic change in voice


In the use case I am working on, I wish to change the TTS voice by passing a parameter in the conversation speech string. For example,

<speak><voice gender="male" variation="1">Hello</voice></speak>

The actions console mentions that we can override the user's default locale and force a particular TTS voice (as above). And it does work.

The question is: how do we set the voice to say: en-AU or en-GB via the voice tag? I tried setting it via variation or language or name, it does not work.

Thanks.


Solution

  • Although SSML supports a <voice> tag with a languages attribute, this isn't one of the SSML tags that are officially supported by the Google Assistant. Although there is evidence that the tag is semi-supported with the gender and variant attributes, the languages attribute isn't.

    Aside from setting the region in the Action console, there is no way to currently change which region's voice is used for your Action.