Help with speech recognizer

I am making the speech recognizer play a sound but when doing so it bugs repeating the same sound 2 times

The idea is that when the voice recognizer detects the command "hola" it plays sound1 but there are times when it repeats it.
imagen_2022-06-29_190551860

This is my app for now and I want to make a kind of assistant that receives commands using the switch and listens every so often but I think that's what makes me bug the sounds that I want it to respond to when executing actions
Proyect_Vivy.aia (3.8 MB)

Hello Enrique

Cannot really see what the error might be with just that snippet of code.

oh sorry, I uploaded my progress when i edited the forum

Reloy1 Timer - for the content of that Block to work, the Timer is already enabled, so remove the 'Timer Enabled to True' Block.

Now - the double Play Sound:

Firstly, 'When Switch1 Changed = True'

If Switch1 is On:
ReconocimentoDeVoz1 [Voice Match, Sound will play]

Then, the Reloy1 Timer is called:
ReconocimentoDeVoz1 [Voice Match, Sound will play]

So there is your bug.

I see your App is work-in-progress. It is best to code snippets as separate temporary Projects, so that bugs in unrelated code do not make the test code fail.

There is a lot to be done on the Bluetooth Blocks - search the help forum!

Proyect_Vivy_Edit.aia (3.8 MB)

Here is an example Project, similar to yours in some respects so you can copy useful Blocks into your Project (via the Backpack).

BT_Basic_Setup_Send_Cmds.aia (8.3 KB)

oh Thanks, when I have time im going to test this solutions.
Sorry for my bad english, im LatinAmerican and there are no forums in Spanish that are active to solve problems with APP Inventor.

There are a lot of Spanish speakers on this forum, Google Translate makes the difference :sunglasses:

Whose project is this?
because I don't understand well, that is, the bluetooth will send the exact text that it will recognize, right?
then in my arduino board I will have to place that when it recognizes the phrase it executes an action, I make it recognize numbers but this can also work for me I will have to try it and investigate

I put it together long ago for someone else on the forum. It worked well for their requirement. It's important to have efficient code to work with speech. Note also that it's a good idea to have code that deals with unrecognised speech.

ok I understand, I will try it later thank you very much seriously

Yes, that's correct. It was a requirement for that Project, but encoding with numbers is often better at the Arduino end. For either text or numbers, you can use Switch() to start an event.

1 Like

This tutorial shows a way to use the SpeechRecognizer to use voice commands: HOW TO: Program the native SpeechRecognizer for Continuous Dictation and to do things . You might find it useful.

Oh Steve I didn't think you would answer my question, I used your tutorial to get started with APP Inventor and voice command programming and modified it a bit to make it fit my project.
Thank you very much for the help but I'm going to try this new way to see if I can make things more organized.
Just a few weeks ago I started my project.
I named her Vivy in reference to the character.

1 Like