alphacep / vosk-android-demo

Offline speech recognition for Android with Vosk library.
Apache License 2.0
714 stars 187 forks source link

Implement SpeechService as a android.speech.RecognitionService #192

Closed abouquet closed 1 year ago

abouquet commented 1 year ago

As the title say. The better we can use existing Android abstraction of SpeechService, the easier Vosk Android will be adopted.

I'm on the way to integrate it and start VoskService with this way

  val recognizer = SpeechRecognizer.createSpeechRecognizer(context, VOSK_SERVICE_COMPONENT)

All we have to to is to make SpeechService extends android.speech.RecognitionService and Android api will take care of the Service management (bind / unbind / start / stop etc...)

There is also a layer adpatation to convert recognition events to match android.speech.RecognitionListener

nshmyrev commented 1 year ago

Thank you for your request. We have https://github.com/alphacep/vosk-android-service project for that.

abouquet commented 1 year ago

Oh, nice ! I didn't see it ! I've got now my own implementation of android.speech.RecognitionService backed by Vosk. I think I'm gonna give it a try with your solution :)