SecretWord
SecretWord
is a speech-recognition app that mirrors the secret word of You Bet Your Life (1950–1960) with Groucho Marx. Secret Word to save the text box in the secret word. Stop to stop the speech recognizer. Image to start the speech recognizer. Then just speak!
Button
saves the text in the TextBox
as the secret word..Button
stops the SpeechRecognizer
.SpeechRecognizer
.There were a couple things to learn about continuous speech recogntion in non-legacy mode:
SpeechRecognizer
detects utterances in the background and returns — in the AfterGettingText
event — continuous recogntion result
s with partial == true
as long as speech is detected. Once the utterance ends, partial == false
, so the SpeechRecognizer
must be restarted.SpeechRecognizer
detects no speech in the background, it will eventually time out in 5 seconds. In this case, the SpeechRecognizer
must be restarted by a Clock
event set to occur after that time out — in this code, the TimerInterval
is set to 6000 ms (since the utterance time out has been empirically determined to be 5000 ms).Stop
procedure will stop the SpeechRecognizer
, but the documentation states that it, ‘works only when UseLegacy
property is set to false
.’SecretWord
also explores how to write scaled text on a Canvas
— embodied in the display
procedure.
Vincent De Oliveira (aka iamvdo) describes font-size, including how the font metrics define the em-square. The default font (sans-serif
) has an em-square and FontSize
that is 110% of the Canvas
width
divided by the length of the secret word. It is centered on the Canvas
(with TextAlign
centered) and surrounded by a rectangle one em-square tall and length-of-the-secret-word em-squares wide — clipped to the Canvas
borders. The text is red within a black rectangle filled with white.
All components retain their default properties, — except Width
and Height
set to Fill parent...
where necessary to center UX components.
🔗 permalink, 🔩 repository, and .AIA
for this page.