Can an Alexa skill keep the microphone always on? - alexa

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.

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.

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

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

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

Google Play Game Services - Real Time Multiplayer - How to get the delay

I am using google play game services – real time multiplayer API to add multiplayer feature to my mobile games. The engine I am using is Unity3D, but my question does not have to do with Unity (I believe so) so it is not important.
What I would like to know is the delay of the messages that are received over the internet to make my games smooth and synchronized.
I know that in other APIs like Photon you can easily find the delay of the message that is being received but I don’t seem to find it on google play game services API.
Is there any way to know the delay of the received messages on google play game services API?
Thank you for your time!
Determining the latency of the messages is a bit complex in the case of Google Real Time multiplayer APIs since the connections are peer to peer, so most of the data travels directly from one player to the other. (see for details: https://developers.google.com/games/services/common/concepts/realtimeMultiplayer#messaging)
The short answer is you can estimate it yourself, by adding sequence numbers to the messages, and then exchange the time difference each client experienced between the messages. I recommend measuring several messages, and sizes, and not have too much memory since conditions will change. Something like the average time between each message for 30-100 messages and then plan for the slowest link.
To make a good real-time game, you really should assume the latency is variable (sometimes it is low, others high), and it is always longer than you want :)
You might want to checkout https://gamedev.stackexchange.com/questions/58450/mobile-multiplayer-games-and-coping-with-high-latency which has a good discussion on how to handle this situation.

GCM the right way to implement turn based multiplayer in GAE + Android

I am currently developing an android game that is turnbased and uses GAE on the server side. Now until now I used GCM to notify when it is a players turn to act, but I came across some threads, that said GCM throttles a lot (speaking about 20 initial tokens for each collapse key and after that you get 1 token back every 3 minutes). But those were threads in which the information was based on users experiences. Now my question is - since I did not find anything official about that, only that throttling "exists" - does anyone know some more "hard facts" or is this the right approach I want to use?
Moves are made between 2 players, and can be as frequent as 1 move every two seconds down to a move a day. I am worried, that people can play quite fast, and then such a restriction would kick in ...
Thanks!
GCM also doesn't guarantee message delivery. I would build some smart polling into the app. Maybe something that polls every second for the first 5 seconds or so and drops off, and use GCM when the response time has been longer than a 5 seconds.

Resources