Aplicativo utilizando reconhecimento de voz com MIT App Inventor

Olá, estou criando um aplicativo de reconhecimento de voz e estou com muita dificuldade em fazer o seguinte comando: Quando se clica no botão, se dizer o nome da pagina, ela abre, caso diga o nome de outra pagina, esta tambem abre.
Estou conseguindo fazer o reconhecimento de voz falar, porem usar o mesmo microfone pra abrir outras paginas não… me ajudem por favor… só falta isso no app…

I'm not sure, if I understand the question...
if you do not want to open another page, don't open it, where is the problem?

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


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

For example: I have an Application that has a side page with several pages. For example: Settings, Music, Add contacts among others. I wish I could press a button and say the name of the page and it opens only with voice recognition, I managed to do this with one page but I was unable to replicate the function for all. Following is a failed attempt to do this with the page of songs.blocks

This tutorial has an example of something similar HOW TO: Program the native SpeechRecognizer for Continuous Dictation and to do things Giovana.

The relevant code would be something like this:

SRcode

instead of saying Musicas ; your recognizer is returning musicas so you need to place
a upcase (or downcase) blocks on both sides of the comparison blocks ( to eliminate the difference between Musicas and musicas ) … that is make them both MUSICAS so it will compare properly your spoken command.

Does that help?

Regards,
Steve

Hi, thank you very much for answering my question, the code helped a lot, but it didn’t work so I made some changes in which make the application open in another tab but it doesn’t work. I will then send some photos to better show the application and maybe I can change what’s missing …Meanwhile, I’m using this code that gave me the opening, Steve and changing it in other ways, in one of the images you will see that I made a similar version of yours.
1 2 3 4


Note: In this last modification the application compiles on the cell phone but the following error message appears.

Sorry, you have lots of errors Giovana. You can fix the problems :).

This is why you get the Runtime error. You are not correctly using the result blocks.

This image shows how the result blocks should be used

. The result is the text that the SpeechRecognizer captures.

When you compare the text of what you say you have to know what the SpeechRecognizer thinks you said. The two things are often different.


Often, the SpeechRecognizer does not provide capital letters (upper case)

Also, developer shoul never re-open Screen1 To get to Screen1 from any other screen you simply use the code close from the Screen you are on.

Maybe the advice here will help you. Sorry, my Spanish understanding is very limited.

Can this Global spoken text be the partial? Because I don’t have this block here.

Can it bee the partial? Possibly. It is better to code as in the example. You have the Block but are not using it in your app. The Block is in the SpeechRecognizer bin and is called SpeechRecognizer.AfterGettingText. The partial is dragged from the control into your coding blocks You use it to tell the SpeechRecognizer to capture everything you said. If you do not tell it to not get partial, it may only report a single word.

aftergettingtext . The result is the words your SpeechRecognizer understands you spoke.

It worked !!! As the pages were and uppercase did not work and as the first page that I can’t change the name was called “Screen1” by choice of the application itself, I thought I could use uppercase on all and in fact I can’t, besides that I didn’t know how to change the code and when Steve gave me the structure it became easier to know what to do. Thank you very much for your attention and for helping me in a prompt manner. Thank you very much! I’ll pass the code here as it was.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.