Maximum duration of user speech input in seconds for Amazon Alexa skill - alexa

I am creating an Amazon Alexa skill and would like to know the maximum duration of user input in seconds that a slot can hold. More specifically the AMAZON.SearchQuery type slot.

I'm not sure there is an official answer to this anywhere in public docs, but I don't think you'll be able to capture more than a few seconds (~8 max ?) of input. Plus if Alexa detects the user is done speaking, she will stop listening and process the utterance. Even a slight pause could be interpreted as the end of speech input.
I don't know your particular use case, but given all that, I would not recommend that slot type as a reliable way to capture long transcriptions. I don't believe there is a good way for skills to do at all currently.

This Amazon Lex blog is from 2017. I don't know if it will still work, but you can give it a shot.
Capturing Voice Input in a Browser and sending it to Amazon Lex

Related

Skill under development not available on all Alexa devices

I am building a piggy bank skill for my kids (no plans to publish it yet). After completing development, the skill immediately became available in my phone's Alexa app and one of two Alexa devices I own (both Echo Shows). Whenever I ask the non-functioning Echo Show ask piggy bank, it replies with I can't do that but for other ideas you can say, Alexa, open Amazon Kids. What could prevent a skill from being available on one but not being available on another device?
Answering my own question in case someone else runs into the same issue... It took me many hours to figure out the problem, even built a second skill and performed a full factory reset. The clue that ultimately led me down the right track was the Amazon Kids part of Alexa's response. On said device I had Amazon Kids enabled because it is in our family room, and I re-enabled it right away after the full factory reset. After disabling it, the skill under development started working as intended.

Can an Alexa skill keep the microphone always on?

I have been a C/C# developer for many years but haven't written any Alexa apps. I would like to write a skill to listen for baby babble (NOT WORDS) and respond in different ways. I would like my Alexa skill to keep the microphone ALWAYS on (similar to how "Alexa, Guard" works) because babies speak randomly.
Is there some sample code I can look at?
You can't do this.
There is no way to keep the microphone open with a custom skill.
When you activate the skill "open my skill", Alexa starts talking and then, when she stops, you have only 8 + 8 seconds to speak, otherwise, the session will be closed.
So you have 8 seconds, then if you don't speak there is a re-prompt phrase asking you to tell something, and another 8 seconds where you can speak.
If you don't, the session will be closed.
There is a way to keep the session open more than 8 seconds (playing some mute music for example), but the problem remains because you can only speak after that "music" is finished.

How can I make my skill listen/wait for a response for an indefinite amount of time

So I am trying to develop a skill that in short allows for users to ask for instructions on how to build various items step by step. However I am running into an issue when, for any given step, an intent will only listen for a response for a total of 16 seconds if a re-prompt is added.
This really hinders the skills because most things you build will have steps that take way longer than 16 seconds.
I am also solely developing this app to be run on devices that support APL so I'm not sure if that information could be of help.
Ive tried using a hacky way of using ssml to play a silent audio file but it can only play files that are at max 90 seconds long, which still isn't enough time. So if any one can lead me in the right direction to solving this issue that would be much appreciated.

See when my skill reprompts users

Is there a way to see if my skill has reprompted a user? I know this happens if a user doesn't respond within an allotted amount of time and it would be informative because I'd like to rephrase some of my responses if this tends to happen more frequently for some utterances than others.
No. At this point, this isn't possible. You might be able to use a timer in your skill service to guesstimate however.

Developing an Alexa skill with custom wait time after re-prompt

I am trying to develop an alexa skill with a custom delay time. Currently, whenever a user asks a question, Alexa responds to it and waits for 8 seconds. After this, there is re-prompt speech (if present) and Alexa again waits for 8 seconds. This 16 second wait is followed by session closure.
I want to keep the re-prompt text to be active even if the user does not ask anything after 16 seconds time out. Is it possible?
This is not currently possible because Alexa will wait for a maximum of eight seconds before closing the session. You can add a re-prompt to reminder a user that a response is required to continue with the skill interaction, but it is not allowed to leave the session open for an undefined period of time. This enables the user to ask for different skills and first party features without closing a skill manually every time.
As with natural conversation, if the Alexa service thinks a question asked is misunderstood or confusing, re-prompts allow Alexa to clarify and reformulate a question to get the answer Alexa is seeking. Shorten a re-prompt for brevity when a customer is familiar enough with the context of a conversation that they won’t need the entire prompt again immediately. The key is that you provide enough information to guide the customer, understanding that you are essentially 8 seconds away from losing that connection if they don’t know how to answer. While re-prompts must be understandable, they provide an opportunity to expand on the initial request to get the conversation moving.
You can find additional info here:
https://developer.amazon.com/en-US/docs/alexa/alexa-design/available.html

Resources