Open nmvprasad opened 3 years ago
Instead of a SpeechSynthesis
, use an AudioFileReference
.
To specify a grammar, create a GrammarReference
and put it into a SpeechRecognition
object. Next, pass this object to the addPrompt
and build
methods of the Interaction.Builder
.
Note: if you don't want the user to be able to barge-in, don't pass it to the addPrompt
method.
See cookbook example.
How to add audio file in the prompt as part of Interaction
Interaction interaction = interaction("get-dtmf") .addPrompt(new SpeechSynthesis("say a number between 5 and 10 digits long."))
Also how to use the grammar file while taking user input and collecting user input by listening to his voice