My VoiceXML provider, Nexmo, seems not to handle the xml:lang="es-ES"
attribute in the root vxml
(This is generated by Rivr with a context.setLanguage("es-ES")
in my Dialog)
I want Nexmo to use a spanish TTS engine but as I am using Rivr, I can't see where I can specify that I want the "prompt" to include, for example, xml:lang="es-es-female"
, so it generates VoiceXML:
<prompt xml:lang="es-es-female">
Hola.
</prompt>
interaction().addPrompt()
only accepts the SpeechSynthesis
object which does not allow (as far as I see) language options.
I've also tried include SSML in the SpeechSynthesis object (using a DocumentFragment
as I see in Rivr Javadoc) but that won't work. Probably Nexmo does not support SSML.
Any workarounds? (A part from changing to a better VoiceXML provider) Thanks a lot!!!
If you only want to play a message without getting input from the user, use can use the
Message
class:If you need to specify the language for a prompt in an
Interaction
, this can be done with theInteractionBuilder
. ThesetLanguage()
method can be used before theaddPrompt()
method. Multiple languages can be used within the same interaction:If you don't want to use the builder, you can do it by hand but it's much longer:
The output VoiceXML is: