Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steps to get vosk-android as an input method on android? #126

Open
khlsvr opened this issue Feb 19, 2021 · 16 comments
Open

Steps to get vosk-android as an input method on android? #126

khlsvr opened this issue Feb 19, 2021 · 16 comments

Comments

@khlsvr
Copy link

khlsvr commented Feb 19, 2021

I'm looking for an open source solution to be able to dictate text to other apps on android.
The kõnele project does just that but their app wants to separate the engine to a server that you can configure in the app, so I would need a server setup and running for it I guess? They provide a server for estonian language.
https://github.com/Kaljurand/K6nele

Having tested the demo of vosk-android, I can see it understanding my english well, and it's all happening on my device, which would be the preferred way. The only problem is that how can I get this as an input method to other apps.

The kõnele calls this feature I guess as a speech keyboard that implements the input method editor (IME) API https://developer.android.com/reference/android/inputmethodservice/InputMethodService

If no one has done this yet, what would be the course to take here? Should you fork and code the kõnele project and embed vosk-android there somehow, or would it be easy to just add the IME functionality to vosk-android? I`m very mediocre programmer, so this may be out of my scope, but I'm just curious.

@nshmyrev
Copy link
Collaborator

Should you fork and code the kõnele project and embed vosk-android there somehow,

It should be easier to modify konele to use vosk. You can probably request help from Kaarel (konele author) on that.

@Felicis
Copy link

Felicis commented Feb 23, 2021

I have just started building a simple prototype by modifying the vosk-demo last weekend. It's in my fork to this repo https://github.com/Felicis/vosk-android-demo.
Feel free to have a look at it, try it out and you're welcome whatever you want to add 😃

Right now it is a simple custom IME keyboard with a connected config app (only needed to ask for permissions). The keyboard is ugly and primitive af right now, so it could be interesting to integrate existing keyboard UIs like the one from konele or even to adapt AOSP or Anysoft.

@nshmyrev
Copy link
Collaborator

@Felicis Coolness! Why not simply integrate it with Konele? It has done a lot of work already I believe.

@nshmyrev
Copy link
Collaborator

Related issues

Kaljurand/K6nele#63

Kaljurand/K6nele#38 (comment)

@Felicis
Copy link

Felicis commented Feb 23, 2021

Omg, time has passed since I last checked on konele: it was just estonian back then, so my bad for not doing my research properly 🙈
Repackaging the vosk-demo as an IME wasn't hard, so I think repackaging it to be a RecognitionService shouldn't be hard either. We should definitely try this and integrate it with konele.

@nshmyrev
Copy link
Collaborator

Also openboard looks interesting

openboard-team/openboard#169

@nshmyrev
Copy link
Collaborator

Other related things

https://github.com/ccoreilly/LocalSTT

Felicis#1

@Tombstone2K
Copy link

Tombstone2K commented Nov 26, 2021

Any update on this?
@nshmyrev @Felicis
You can make VOSK into a RecognitionService.....so any app which supports RecognitionService can use VOSK

@Felicis
Copy link

Felicis commented Dec 16, 2021 via email

@Tombstone2K
Copy link

Well, take care @Felicis .

@jwmh
Copy link

jwmh commented Feb 5, 2022

I strongly suspect there would
be a LOT of public $$$ FINANCIAL support for a project like this ...

Could that help folks?
If so how much $$ (hourly) would you need? And how much Monthly?
I realise this is for numerous reasons probly not an easy question to answer...

We could look into setting up Liberapay for this!!
(Context:
liberapay is a
Nonprofit alternative to Patreon;
uses Stripe and Paypal as payment processors (those two charge processing fees, but liberapay itself doesnt) ;
is supported wholly be its own platform (i.e. Liberapay eats their own dogfood to pay itself)... doesnt charge fees!
)

@Felicis @Tombstone2K @nshmyrev @khlsvr

@adeyo50
Copy link

adeyo50 commented Mar 17, 2022

Any progress on this? I'm not a developer but for privacy and security I would love to see this completed. I'm a bit of a hack and can follow instructions as a used to root my phone's all the time. Here are a couple other links that may or may not apply but could help...

florisboard/florisboard#1587

https://github.com/ElishaAz/Vosk-Voice-IME/releases/tag/v1.0.0

https://github.com/Kaljurand/K6nele/tree/v1.7.56

i installed a couple of the apps previously listed and was able to do this (see short video). I selected the u.s. language pack of Google found within the konele app settings. Also, performed an internet search using the konele app. Best thing I found is that both speech recognition apps work flawlessly in airplane mode and offline. Is it possible to integrate one of these into florisboard or anysoft keyboard with a mic button? https://u.pcloud.link/publink/show?code=XZyo8VVZDkYjC091nHBV56Ba95e8PFHCh8Sy

https://u.pcloud.link/publink/show?code=XZQyQVVZjAf2bTN5b4QGbU8PiXU1fubqhxPV

As I said, I'm not a developer but I know enough to test out a few things if they are posted. I have Galaxy Note 20 ultra running Android 10 and Google pixel 6 Pro running graphene OS.

To be able to dictate text messages or sync this to search my internet browser Andy Google completely would be amazing.

I too would pay have somebody help put something together even if it was just packed for my personal use.

Hoping everybody is healthy and able to jump on this again!

@nshmyrev
Copy link
Collaborator

@adeyo50 you can install https://github.com/alphacep/vosk-android-service. It works somewhat.

@adeyo50
Copy link

adeyo50 commented Mar 19, 2022

@adeyo50 you can install https://github.com/alphacep/vosk-android-service. It works somewhat.

Thank you!! I'll try it out!

@jeanlaroche
Copy link

@adeyo50 you can install https://github.com/alphacep/vosk-android-service. It works somewhat.

How can I try this without having to build it? I too am very interested in having voice typing support in keyboards (for grapheneOS in my case). adeyo50 shows some really useful stuff, for example, I installed the Vosk keyboard that allows switching back to your regular keyboard, that's a good first step.
Like adeyo50 I can hack and test stuff...

@sogaiu
Copy link

sogaiu commented Nov 3, 2022

@jeanlaroche I built some .apks of vosk-android-service based on a slightly modified version of a recent commit.

FWIW, there is some description of where to get them and how they are different here: alphacep/vosk-android-service#11 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

8 participants