Converting Text into a Number

I’m currently working with the Speech Recognizer. What I want to achieve is, that when I say a number, the programm should also use this number. But it looks like instead of an integer, the speech recognizer delivers a string. I was wondering if there is a way to convert the string, from the result of the speech recognizer, to an integer.

Test the speech recogniser output with the isNumber block. AI2 will handle numbers in text blocks and number blocks as numbers e.g.


This is my function, where I activate the speech recognizer. The result is then set to global time value.

After I got the text I check if it’s a number.


The app always tells me, that my voice-input is not a number


Have you tried passing the speech output through a long lookup-in-pairs list block to translate English number phrases to numbers?


the SpeechRecognizer component works asynchronously... which means, you get the result back in the AfterGettingText event... you programmed your blocks as if the result comes back immediately, which does not make sense...



Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

1 Like

Ah, I see what I did wrong now. Thanks for your reply. The app works now as intended

Btw, exactly what I showed in my example above.