vosk model selection in GUI

This commit is contained in:
Priler 2026-01-05 03:38:04 +05:00
parent 36acacf259
commit cab53abcbe
14 changed files with 323 additions and 40 deletions

View file

@ -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),