Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add audio file in the prompt as part of Interaction #19

Open
nmvprasad opened this issue Sep 12, 2021 · 1 comment
Open

How to add audio file in the prompt as part of Interaction #19

nmvprasad opened this issue Sep 12, 2021 · 1 comment
Labels

Comments

@nmvprasad
Copy link

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

@gawi
Copy link
Member

gawi commented Sep 12, 2021

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.

@gawi gawi added the question label Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants