Alexa skill SSML talking speed - alexa-skills-kit

Am a building an Alexa skill and I need to spell out a code for the user. I have wrapped the code in a say-as tag. The problem is that Alexa spells out words really fast. so fast that its basically useless. Is there anyway to vary the speed of the say as tag?
"<say-as interpret-as='spell-out'>" + code + "</say-as>"

Ok I figured it out. this may not be the best solution but for the moment it works. What I was doing was
"<say-as interpret-as='spell-out'>" + code + "</say-as>"
What I ended up doing was this
code.split('').join(' <break/> ')
split takes turns the string into a char array and then join puts them back together with the break tag between each letter. you can then use the time attribute to change how long of a pause is taken.
<break time="3s"/>

Related

How to prevent RangeError: Maximum call stack size exceeded in a finite recoursive function? | JavaScript

I am trying to make a Connect 4 Bot which uses a minimax algorithm to function.
Apparantly going through all the possible game states is too much for my program, so I need a way to prevent the error from happening.
I saw that you could use setTimeout() to make big recursive functions runnable in JavaScript but I didn't really find a way to understand it.
So I wanted to ask if anybody could maybe make an example of how to implement setTimeout() into an recoursive function to make it runnable.
(Sorry for possible english mistakes.)
I would say a better way is to use the so called iterative deepening. I don't know Javascript at all, so forgive me for posting in pseduocode/Python.
start_time = current_time
for depth in range(1, inf):
score = minimax(depth, ......)
if current_time - start_time >= max_allowed_time:
break
So you get the time when you start the loop. Then you go deeper and deeper (from depth 1 and onwards) until the current time minus the time you started looping is more than your specified maximum time value. Now it will search for as deep as it can within the given time limit.
At first glance this might seem to be slower than just searching for a given depth. But it will actually speed up your code if you implement for example move ordering and transposition tables later on. And since the time for each depth goes up exponentially, the time it takes to search first depth 1, then 2, then 3 is negligible larger than searching for just depth 3 right away.
Hope I make myself clear, Englihs is not my native language either :)

multinote instruments and chords

I am new in ableton live software. I would like to understand why for some instruments I can play several notes at the same time (and create chord progression) and for the others I can hear only one note of a chord.
For example, there are two guitars: 'Power Chords Guitar' and 'Please Rise For Jimi Guitar'. Both of them are basing on an operator. For the first one I am able to press several buttons on midi keyboard and hear a sound, for the second I can hear only one note of a chord.
I was trying to compare operator options, but I was unable to find the setting which causes this multinote/mononote functionality.
Thank you very much for your help.
J
Ableton's Operator consists of 4 monophonic oscillators. Depending on a preset, it can be setup to play polyphony. It seems that the Glide function is responsible for that effect. Make sure you have at least 2 oscillators (the more the more poly) with Glide "on" set.
Check out Ableton's webpage for reference on how to use its instruments.

MediaFoundation - Frame is ready?

I am using Media Foundation to play a video, which I need to edit in real time, so I need to know when a frame is ready to be presented, but the callback does not offer such a message.
My only idea is checking the frame rate, then setting a timer to just shy of that and using GetPosition to check where I am against where I was the last time the timer was called, but there must be a better way than this.
Thanks!
Matt
Why can't you inject your own IMFStreamSink instance in the topologoy, do the editing in your implementation of IMFStreamSink::ProcessSample and passing the edited to whatever output node you are using currently?
Also, if you are using EVR, you could make a custom presenter - see this article on MSDN.
I found an easy solution. Set the playback speed on the session, then create a presentation clock from the session. Set a timer, and check the presentation clock. When time has passed equal to the playback speed for one tick, a new frame is being presented.

Inform 7: Something that was only supposed to happen in one place during one event is now happening every time the player inputs a command

When the player character goes into the Staffroom at the orphanage/boarding school they live at, said player has two turns before they hear the manager's footsteps coming down the hall and they are urged to hide. I've done this through use of number variables. At this point I have another number variable (set up like a true/false thingy by only using 0 and 1) to govern whether or not trying to do anything except 'hiding' or 'hiding wrongly' gives the response 'There's no time for that, just hide!'. The problem is this: Whenever I start the game, ANY ACTION is rejected and met by 'There's no time for that, just hide!'.
Code:
NOTSITS is a number variable.
When play begins:
now NOTSITS is 0.
Every turn when the location is the Staffroom:
increase NOTSITS by 1.
Every turn when the location is the Staffroom:
if NOTSITS is 2:
now HYF is 1;
say "From the hall outside, you hear footsteps... Shit, that sounds like Rodger![paragraph break]HIDE!".
HYF is a number variable.
When play begins:
now HYF is 0.
Every turn :
if HYF is 1:
instead of doing anything other than hiding or hiding wrongly:
say "There's no time for that, just hide!".
Hiding is an action applying to nothing.
Understand "hide" as hiding.
Hiding wrongly is an action applying to one thing.
Understand "hide in [something]" as hiding wrongly.
Instead of hiding:
try entering the empty cupboard;
now HYF is 0.
Instead of hiding wrongly, say "Don't waste time with stupidity, just hide!"
Please don't suggest using Inform 7's own time system to solve this. I tried that and it was a far bigger shizztorm of problems than this has been.
I think the problem is that you're relying too much on every turn rules, but they run after the actions have all been processed, so it's too late for them to do what you want them too. I also defined hiding as a synonym for entering, because that action already exists, and it's what you want to happen. So try this instead:
First turn is a truth state variable. First turn is true.
The staffroom is a room.
In the staffroom is an enterable container called the empty cupboard.
Understand "hide" as entering.
Carry out entering when first turn is true:
now first turn is false;
Understand "hide in [something]" as a mistake ("Don't waste time with stupidity, just hide!").
Instead of doing something other than looking or entering when first turn is true:
say "There's no time for that, just hide!";
(Also in the future it will help if you provide the full source code, or at least all that's relevant. This time you left out the staffroom and cupboard.)
You can specify an action and its time of appearance after entering a room:
After going to Staffroom for the first time:
manager comes in three turns from now.
At the time when manager comes:
YOUR STUFF

Classic ASP App CINT failure - twitpocalypse v2

Due to a qty value exceeding what a VBScript INT can store, I'm getting a pretty nasty error message (actually the users are)... This is totally a case of twitpocalypse.
Since CINT() will not work in this situation, what is the best workaround?
requestqty = 40200
CInt() max = 32767
CInt(requestqty)
EDIT
CLng() seems to do the trick, any risk to the code to change all CInt() to CLng(). From what I've read below and elsehwere on the web, it seems like there is really very little reason to even use CInt(). I didn't write this particular app and don't know why one was used over the other, but would prefer to not bandaid the issue and completely fix this issue in the app so it does not happen again...
Aways use long instead of int in VBScript (unless you specifically want to limit the value to the int range).
There is no performance benefit for using the smaller type, and there is no storage size benefit because all variables are variants, so all simple types use the same amount of memory.
Use the CLng function instead of the CInt function.
CLng or CDec or CDbl
CLng() and using a Long instead of an Int?

Resources