Voice driven App: how to make an app execute Voice commands

718 views
Skip to first unread message

bianca fenice

unread,
May 30, 2016, 5:12:51 PM5/30/16
to mitappinv...@googlegroups.com
Can we use the speech recognition system within App Inventor to "drive" an application with your voice for example passing the application simple commands run by the application itself as well as if they were given by a touch of fingers?
The response is: yes we can.

What I have done is just an example to make possible to better explicate what I am talking about.

Into the Following really simple application you can just press the button "Try Voice" to start the voice recognition integrated. Than you have to say a command picked up from a certain command list with the command you want the application runs.
The words you can say are just some examples to better show the functionality.

The app che be set up so that each word pronounced by the user can trigger and run a specific command or function.
But of course it is possible to set a list of words that run the same command or function.

If you want, you can set up the app to recognize more languages, just adding more commands to a certain list related to a certain routine.

In this example you tap the button than you can say one of the following commands:
"stop" that runs just another Fire on Ice
"horizontal" that turns the screen in landscape mode
"vertical" that turns the screen in portrait mode
"now" that show a message where is shown some data acquired from the clock function "now"
also you can say a lot of different voice commands that make the device to run the routine that says aloud the date and the time into a customized format


If you have your device set up in ita use Italian commands list if your device language is eng than use the English list of commands above



Finally if there is no command into recognized commands list, the app shows an error message that could be customized without any problem because it is just an alert of the App Inventor built-in Notifier + a text string.



Comments and improvements are welcome and appreciated.

If someone wants it I can upload the aia file

ScottFerguson

unread,
May 30, 2016, 8:10:21 PM5/30/16
to MIT App Inventor Forum
Nice and simple solution.
It looks like it would be easy to add new commands.
Keep up the good work!
---
sf

bianca fenice

unread,
May 31, 2016, 11:00:57 AM5/31/16
to mitappinv...@googlegroups.com
Yes it is really easy to add new commands: just add a new "if else" statement, the command and the routine to execute.
Anyway, it would be better the use of the Switch Case or Select Case statement instead using the if statement. But AI doesn't have yet. Hope in the future will.
An alternative would be to have the possibility to call a routine whose name is contained into the variable "result" of the speech recognizer. But AI doesn't have the possibility to call a routine whose name is passed to call statement by a variable. If it was, all the programme I made would be even shorter. In this case the user of the app says the command "xyz", the command is recognized by the speech engine and saved into its "result" variable, than such a variable is passed to the "call" statement that calls the routine to run: the command "xyz" itself is the routine name. The rest is obvious.

Hope in the future will be possible to have Select case statement in AI and the possibility to pass a routine name as a variable to call statement, would be another appreciated improvement for AI dev platform.

Taifun

unread,
May 31, 2016, 11:59:25 AM5/31/16
to MIT App Inventor Forum
@Bianca, let me quote Ghica from one of your other threads https://groups.google.com/d/msg/mitappinventortest/HHuyXVTngmo/pHf-8cBECgAJ

be happy with and be amazed at what App Inventor offers.
Be patient and find workarounds for what App Inventor does not offer.

and as already said: 
App Inventor is Open Source, you are invited to add new features, the sources are here MIT App Inventor sources and here is the Open Source Forum https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!forum/app-inventor-open-source-dev
Thank you.

looking forward to your contribution.
Taifun

bianca fenice

unread,
May 31, 2016, 1:32:48 PM5/31/16
to mitappinv...@googlegroups.com
Maybe I am I misinterpreting something about this group, so please clarify to me the following:
Not my intention to be impolite but I don't understand what do you mean about "be happy..."
Might It be that I don't have to advance any Improvement or feature requests for this developing platform in this group?
Is this group the wrong place to ask for such a things? If yes what is the right place for?

Taifun

unread,
May 31, 2016, 4:37:00 PM5/31/16
to MIT App Inventor Forum
  1. the primary target audience for App Inventor are people with little or no programming experience
  2. App Inventor is a teaching environment, but no full programming environment like Eclipse or Android Studio
  3. The MIT App Inventor team is a very small team and they know the limitations of App Inventor themselves
If you compare App Inventor and Android Studio/Eclipse, you will find out, that a lot of features are missing in App Inventor. You can easily create a list of hundreds or thousands of missing features

You already suggested several features. That's great! And if there is another important feature missing, then feel free to suggest it in this forum. Better however would be to contribute instead of only suggesting, see also your other thread about the App Inventor sources https://groups.google.com/d/msg/mitappinventortest/W6WgpgCf29E/TeaBaSRoCgAJ

Taifun

bianca fenice

unread,
Jun 1, 2016, 10:25:15 PM6/1/16
to MIT App Inventor Forum
Ok thank you so much for clarifying this topics.
I'm trying to get involved with AI because I like the idea to create some software with my hands so I'm doing some exercises to improve my AI skills: it is easy and awesome to learn and use (and a bit slow on my pc).
But with Eclipse or Google Android Studio is really more difficult. I tried a while ago but I had lots of learning problems... and not only... With GoogleAS even the installation is difficult, about impossible: I have an old PC (about 2002) and I can't install it: really toooo slow. Eclipse, I didn't tried yet but I don't think is much more different from GoogleAS; I also tried netBeans, and others devTools for other languages (I'm just a newbie in some languages I do little things), but my Java skills are about zero.
Reply all
Reply to author
Forward
0 new messages