1

I am developing android application. I my application I need speech recognition.But I need speech recognition as service. I already create simple speech recognition in which when I click on button it start recognizer intent.It works fine and gives me output. But what I need when user click on button speech recognition start as service (in background).When user start specking it start recognizer and give me output.

I read few question regarding this but not getting proper solution to this kind of functionality. Is there any way to implement this. Need help... Thank you

nilkash
  • 7,408
  • 32
  • 99
  • 176

1 Answers1

3

There is some code that does exactly what you need here:

https://github.com/gast-lib/gast-lib/blob/master/library/src/root/gast/speech/activation/SpeechActivationService.java

See it running by downloading this app.

The code is a Service that runs in the background, listening for the users speech. When the user speaks a certain word, it fires an Intent. The Service also puts up a handy Notification while it is listening. There is some other code that starts and stops it here.

gregm
  • 12,019
  • 7
  • 56
  • 78
  • @nilkash: did u try this. did it work? can you post the final code? – Parth Doshi May 12 '14 at 17:33
  • That's awesome! I have liked. I have just one question: Can I put this into a separate thread in a service? Thanks! – Ruchir Baronia Feb 06 '16 at 16:38
  • @gregm . i want to do an app that it recognize user speak. if they are the same, sth happens. and want to do it in background. is yhis code help me? http://stackoverflow.com/q/37225500/4568864 – Mina Dahesh May 31 '16 at 16:34
  • It isn't possible yet to do speech recognition in the background using Google's tools. Sphinx might work but it has been challenging to get that running. – gregm Jun 01 '16 at 12:46
  • I wonder how much strain on the battery this would put, say if I had such an app (service actually) run continuously.. – Zuzu Corneliu Nov 21 '16 at 17:41
  • 1
    app link is dead – J4S0Nc May 18 '17 at 13:56