Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch app on voice command (android)

I need an example of how I could launch my app on a voice command (trigger word). So some sort of a service running in the background listening to everything and if the word matches a set textual value (I guess this can be done through Voice Recognition), app will open. I know this is possible, but I've no clue where to start...

I see other apps are able to establish this. I've close to 1 million users and this is one of the most often requested features.

like image 805
jjj Avatar asked Mar 06 '13 15:03

jjj


People also ask

Can Google assistant launch apps?

Google Assistant enables voice-forward control of Android apps. Using Assistant, users can launch apps, perform tasks, access content, and more by using their voice to say things like, "Hey Google, start a run on ExampleApp.".

Where is the voice app on an Android phone?

From the Home screen, tap the Apps icon (in the QuickTap bar) > the App tab (if necessary) > Tools folder > Voice Command .


3 Answers

To do this you have to run Android speech recognition as a service instead of as an activity. Then have your service listen for the key word or phrase.

Check out this git for example code on how to run Android speech recognition as a service:

https://github.com/gast-lib/gast-lib/

like image 86
mnutsch Avatar answered Nov 04 '22 00:11

mnutsch


Google has just introduced a new voice interaction API from android M. You can checkout the video here, http://www.youtube.com/watch?v=OW1A4XFRuyc&list=PLOU2XLYxmsIJDPXCTt5TLDu67271PruEk

like image 34
Hamzeen Hameem Avatar answered Nov 04 '22 00:11

Hamzeen Hameem


On Android 6 and later, you can just say "Ok Google" or click on the microphone icon, then say "launch YourAppName", and your app will be launched.

If Google voice search cannot recognize your app's name, try to spell it out.

To turn on "Ok Google" voice search: https://support.google.com/websearch/answer/2940021?hl=en

Hope that helps!

like image 34
pdinh Avatar answered Nov 03 '22 23:11

pdinh