Allow vosk alternatives.#28
Conversation
Stypox
left a comment
There was a problem hiding this comment.
Maybe instead of creating a new function that handles multiple inputs, I'd just change the signatures of the onInputReceived and notifyInputReceived functions to take a List<String> (not String[]) instead of just a String as input. The input devices which produce only one alternative output could just use notifyInputReceived(Collections.singletonList(input)) and obtain the same result. The confidence parameter is not used, so just don't add it, but instead explain clearly in the javadocs that the list of inputs must be sorted by confidence, with the first item being the most confident one.
Stypox
left a comment
There was a problem hiding this comment.
Sorry for the double review, I accidentally pressed the "Submit Review" button.
Thank you for the pull request, this could be a great improvement :-D
|
There shouldn't be any duplicated code anymore. |
There was a problem hiding this comment.
Once you solve this and the other comment about documentation, this is ready to merge, thank you!
Vosk can output alternative outputs with less confidence. These outputs are used when there's no skill matching to the first input.
Removed redundant code
|
I pushed some commits, fixing the comments I made above, reformatting the code and fixing a couple of small things. Thank you for the contribution, this seems to really help sometimes! |
vosk can be configured that it shows results with lower propability. They are tried when the first result doesn't return a skill.
This should help to get less errors.
I got lags with this new version. But I'm not sure if this is the fault of this commit.