-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat: plugin rework #3
Conversation
The minor changes: - updated readme - updated pubspec.yaml - added barrel file - added ModelLoader to simplify model loading - load model in separate isolate
…he example app accordingly
…recognition errors
…n wrong arguments names or types where sent. Removed some unnecessary exception handling. +small fixes
…n wrong arguments names or types where sent. Removed some unnecessary exceptio n handling. +small fixes
…stence check, before call its functions. Added spech service destruction before program closing.
Cool job done, thanks a lot! I'll publish coming days on pub.dev Please let us know if you have other thoughts! |
I published https://pub.dev/packages/vosk_flutter but didn't test fully, thanks a lot again! |
🚀 It looks great, you can actually transfer the package to a verified account associated with your domain(https://alphacephei.com/), more info about this here |
Hi there!
Me and @EvgeniyVabishchevich reworked the plugin to make it more flexible and useful (sorry for making this PR so huge).
Motivation
I am using this plugin in my private project and I felt a lack of control over recognition when using it. There was also an unpleasant bug: the model was loaded in a separate thread on the Android side, so
await VoskFlutterPlugin.initModel(modelZip);
didn't wait for the model to load, and if you had started recognition immediately after that, you would have received an error.Major changes
Bumped VOSK android lib version to
0.3.46
Added the ability to create and work with VOSK
Model
s andRecognizer
sNow you can create multiple recognizers, configure them and use them to recognize audio data.
Applied very_good_analysis
To keep the plugin's code readability and the overall code quality at a high level.
Added unit tests
Utility code that doesn't use platform calls are covered with unit tests
Added integration tests
To test the code that use platform calls I added integration tests that can be run on an android device or emulator.
Configured Github Actions
To check the style and formatting of the code, to run unit and integration tests on each pull request. There is also a badge in Readme.md which displays the status of the last worklow run:

Minor changes
Further thoughts
FFI
This has already been mentioned in #2, but it would be great to use Dart FFI to interact with VOSK lib, as it's done in Java VOSK API via JNA. Maybe I'll try to do that somewhere in the future 😃.
Publishing
It will be great to publish the plugin to pub.dev to make it more accessible for developers. But it will take some effort on your part. If you would like to publish the package and will have time to do so, please feel free to contact me with any questions.