manuindersekhon / mozilla-deepspeech-flutter

Mozilla DeepSpeech in flutter using Dart FFI
34 stars 9 forks source link

Are there any plans of publishing this library in Pub.dev? #5

Open dhombios opened 2 years ago

dhombios commented 2 years ago

Most speech recognition libraries available in pub.dev can't process audio files as they just use the speech recognition capabilities provided by android or ios. Therefore, this project seems quite interesting as it allows more advanced tuning and a wider range of applications. However, being just available in github makes it harder to find as most flutter packages are provided through pub.dev

manuindersekhon commented 2 years ago

Hi @dhombios, Right now, I have included the very limited set of functions for deepspeech library. I am not working further on it right now, but if more functionality is added from the lib, then I think it will make more sense to release it as a package.

dhombios commented 2 years ago

What other parts of the deepspeech library do you consider that this port should include in order to be published? I don’t have a lot of spare time, but I might be able to work on it from time to time

manuindersekhon commented 2 years ago

There are two major features left which I think we should include before releasing the library. Hot word feature and Decode audio from stream

Currently, we give it the whole audio buffer and it decodes in one-shot only. I think realtime decoding from audio stream should be there for a speech recognition library. Though I am not sure how feasible this will work in flutter application, and how I am gonna test them in example app. Another approach would be to release the library as alpha right now, and work on the above features later. What do you say?

dhombios commented 2 years ago

I think that being able to decode an audio stream at least in desktop environments is an important feature, as there are other flutter libraries that allow doing that using the native API of the target platform but they just support mobile and web targets. Therefore, I think that it is better to wait until it is implemented to publish it

Regarding the hot word feature, I wouldn't expect it to be quite problematic to port

I might be able to start working on this next week, but as I'm still getting familiar with flutter (I come from the embedded world) I think I'll start with the hot word feature, which seems easier

dhombios commented 2 years ago

I've been reviewing the header files of the deepspeech library, but those features are not exposed in them. Did you make those headers or were they provided by mozilla? (In case they were provided by mozilla I understand that additional headers are needed)

manuindersekhon commented 2 years ago

Yes. I had created these header files myself. Main idea of this project was to create the tutorial on how to integrate libs with flutter applications using dart ffi. If we are exposing all functions, then we can directly use the header file of mozilla to skip duplication, and remove my header file. You can also explore ffigen package, which auto-generate ffi bindings from C header file. Then only flutter integration part will be left. It will create all the necessary structs and pointer conversions.