Skip to content Skip to sidebar Skip to footer

How Can I Trigger Alexa Intent With Clicks Rather Than Voice?

I am working on a flask app that links to Alexa skills. I am trying to building a capability when a user click on some content (e.g. notifications), Alexa asks if the user wish to

Solution 1:

As you say the intent is triggered by voice. A relatively easy way to do it would be:

Generate the audio file expressing the intent using polly tool. E.g. "play my song" https://docs.aws.amazon.com/polly/latest/dg/API_SynthesizeSpeech.html

Whenever the user clicks on the web link, invoke the intent using the PostContent API. Basically pretending the user said it.

An example of invocation would be:

aws lex-runtime post-content  --bot-name yourBot --bot-alias \"\\$LATEST\"  --user-id youruserid--content-type \"audio/l16; rate=16000; channels=1\"  --input-stream request.wav answer.mp3

where yourBot is your Bot name and request.wav is the audio file previously generated with polly. You will get the audio answer in the file answer.mp3

Drawback is you need to use lex/lambda for this, not just flask... Hope it helped! Ester

Post a Comment for "How Can I Trigger Alexa Intent With Clicks Rather Than Voice?"