vosk model selection in GUI
This commit is contained in:
parent
36acacf259
commit
cab53abcbe
14 changed files with 323 additions and 40 deletions
|
|
@ -6,6 +6,9 @@ use once_cell::sync::OnceCell;
|
|||
|
||||
use crate::config::structs::SpeechToTextEngine;
|
||||
|
||||
use crate::vosk_models;
|
||||
// use vosk_models::{scan_vosk_models, get_model_path, VoskModelInfo};
|
||||
|
||||
static STT_TYPE: OnceCell<SpeechToTextEngine> = OnceCell::new();
|
||||
|
||||
pub fn init() -> Result<(), ()> {
|
||||
|
|
@ -30,6 +33,7 @@ pub fn init() -> Result<(), ()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
pub fn recognize(data: &[i16], partial: bool) -> Option<String> {
|
||||
match STT_TYPE.get().unwrap() {
|
||||
SpeechToTextEngine::Vosk => vosk::recognize(data, partial),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue