Error Voice Calculator Starter tutorial

I am going through tutorials I will be using with students. I have followed the directions for the voice calculator starter to match the code shared. However, whenever I share a prompt such as "what is 3x5" it shows me what I heard, but then outputs the default response sentence of "I could not understand..." Can someone assist with what I'm missing to have this be functional? Thanks

Dear @SciLASoc,
there are many things that you can do to debug your code.
I see that you display always the sentence "I do not understand..." and you overwrite it only if the split has successuffly found two numbers in the speechrecognizer result.
So what you can verify at first is if the list has two items, then what are the items (you can print them in "temporary" labels).
After the speechrecognizer has shown you what it has understood, are the spaces correctly positioned ? i mean: what(space)is(space)3(space)x(space)5.
At least this is the approach that I would have to debug the code. More steps can arise after this first one.
Best wishes.

Thank you for the information. I built the code based on exactly what was provided in the tutorial, so I'm a little lost on how to adjust this to make it work. I know there are bugs, I'll give it a try, but I'm concerned that the tutorial is incorrect and therefore won't be helpful for students. I'll keep playing with it to see if I can find a solution. Any other workaround ideas will also be appreciated. Thanks again!

Can you provide a link to the tutorial?

Some of those are thorns in our sides.

1 Like

So the code in the extractNumbers procedure works by splitting the string at spaces. If you are correct that the speech recognizer is returning "what is 3x5", there are no spaces separating the numbers from the operator. Therefore the returned list would be empty and the path to calculate not taken. Note that the speech recognition is done by a platform-dependent service and so the results vary depending on the operating system and device manufacturer.

I have not been able to test this code as I'm currently in the air, but it should provide a more robust parsing mechanism versus splitting by spaces.

I realize that there was a logic error in my previous post that would result in errors. This version should be better.