SpeechRecognizer runtime errors

I was starting to write the code and i cant figure out this please help

Without using “or” block

So, are you going to show your code Blocks? Your description of your coding problem is interesting . It is solvable. Without seeing an image of the blocks you coded so far, no one can help because to provide specific advice, someone has to know what you coded.

Please download and post each of those event block(s)/procedures here …
(sample video)

so in this block whenever i say the word “whatsapp” it will open “whatsapp” but if i say any other sentence like “open whatsapp” or “could you open whatsapp” the app should open it
so what i was asking is that, whenever it(app) gets an input sentence containing a word whatsapp it should open it

You can use code similar to these Blocks @Devil_Rider

. The example blocks use keywords to fill different TextBoxes, you want to execute the ActivityStarter procedure.

Code a test Project as shown. Doing the coding will allow you to see how these Blocks work. Whenthe code works, substitute “whatsapp” for “hello” and replace the setTextBoxtoLabel1.Text with your ‘procedure’. Also, eliminate the If and contains text block from the procedure you already created.
whatsappIntent

Rename the Procedure from ‘procedure’ to ‘goToWhatsApp’ or some similar. Leaving the Procedure with it’s default name sometimes causes issues.

Try the example code (make sure you include the UseLegacy=false code). Let us know how it works. When the example works; modify the code to do what you really want to do.

Regards,
Steve

Could you teach us how to speak in Capital letters?
62905bf03dac965a954743dfbe95807204729009_2_690x188

1 Like

twice Action?


Taifun


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

1 Like

It was helpful

1 Like

It was activity class

1 Like

I was doing the blocks and then came with another idea can you please give the code block of what i am going to mention below:
First the app should take voice input then store it in a variable the input voice may contain sentences like"open whatsapp" or “i now require whatsapp” and so on… but the main keyword in all sentence is whatsapp so the voice should be split at spaces and stored in a “list” then the app will check whether the keyword (here whatsapp)is present or not in the list if present then it will open it with the help of activity starter else it will show not found

1 Like

what about you trying something yourself?
this is not a "give me the blocks" service...

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles
How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .

Also do the tutorials Our Tutorials! to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun


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

2 Likes

You already have the basic code to do this. After the else if blocks, place an else block. In the else block place a Notifier.Alert Block or Label that will show "DID NOT FIND AN ACTIVITY, speak slowly and clearly and try again" or "not found" Try to experiment as Taifun recommended. Thank you.

Here are some resources to help you learn to use the AI2 tools. A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.

There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles

How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .

Also look here App inventor español. Offline. Tutorial. Ejemplos. Instalación. Códigos. Juegos. Curso gratis de App inventor. and here Tutorial Index | imagnity for more tutorials.

1 Like

I'm trying to use a SpeechRecognizer block (with use legacy checked) and, after the app is built and installed on the phone, I got this error:
Runtime Error
invoke: no method named 'Speak' in class java.lang.Boolean
It used to work fine in older projects. I don't know what I'm doing wrong.
Can anybody help?

1 Like

We can't see your code, so we don't know either Martin. This might be an issue related to the Android version you have on your device. Does the app work ok when using the Companion?

Are you using a TextToSpeech block in this app? " It used to work fine in older projects"...are you using identical code? What happens if you re-compile one of the 'older' Projects?

Using the legacy checked is supposed to allow you to build an app that uses the Google prompts. Have you tried building the app without checking legacy?

1 Like

Thanks a lot Steve.

Seems that something went wrong wen importing some blocks from an old proyect using the back pack (now I remember that it gave me a message telling that some file couldn't be saved).

I went back one version. Re do the work using brand new blocks, and now it works fine.

2 Likes

hi i am new to this i was wondering if u could help me after school at 4;00 today steve please

Welcome Caden.

Almost anyone in the community is willing to provide advice anytime someone asks a question about App Inventor programming. Start a new topic and ask your question. Someone will respond (not necessarily me). A lot of people probably know enough to provide useful advice and help with your questions. :slight_smile: