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

Linux support #8

Merged
merged 9 commits into from
Apr 5, 2023
Merged

Linux support #8

merged 9 commits into from
Apr 5, 2023

Conversation

sergsavchuk
Copy link
Collaborator

@sergsavchuk sergsavchuk commented Apr 5, 2023

image

How it works

Linux support is based on the use of the dart FFI.
We generate dart bindings to native C functions from declarations in vosk_api.h using ffigen. Then we add the vosk lib binary to the list of libraries bundled with the application and load that binary using our custom CLI tool. And that's all, now we can call native C functions from the dart code.

CLI tool

Plugins CLI tool is responsible for loading the Vosk binaries(currently only for Linux). It has single command(install) with options generated from options.dart using build_cli.

Helpful resources

Github Actions

  • added linux_integration_test job to run integration tests for the Linux platform
  • added workflow_dispatch trigger to add the possibility of a manual workflow run (for example, if you want to run the workflow after direct push to master)
  • fixed issue of workflow not running on pull request

Other minor changes

Things to discuss

Vosk API header

Initially I've tried to add vosk-api as a submodule of the repository, but there is a bug in publish command, so I abandoned that idea and just put the vosk_api.h to the project by hand. Maybe there is better solution that I don't see.

Versioning

I've just bumped the plugin version to 0.3.47 according to the Dart community convention:

Although semantic versioning doesn’t promise any compatibility between versions prior to 1.0.0, the Dart community convention is to treat those versions semantically as well. The interpretation of each number is just shifted down one slot: going from 0.1.2 to 0.2.0 indicates a breaking change, going to 0.1.3 indicates a new feature, and going to 0.1.2+1 indicates a change that doesn’t affect the public API. For simplicity’s sake, avoid using + after the version reaches 1.0.0.

@nshmyrev nshmyrev merged commit 83f50b8 into alphacep:master Apr 5, 2023
@nshmyrev
Copy link
Contributor

nshmyrev commented Apr 5, 2023

Cool, thank you!

I've sent you a request to join repo with write permissions. It would be great if you could join!

@sergsavchuk sergsavchuk mentioned this pull request Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants