Draft 2 (failed)

This commit is contained in:
msqr1
2024-01-18 23:47:10 -08:00
parent 97ba7ee1b8
commit 91a21271d5
22 changed files with 350 additions and 299 deletions

View File

@@ -1,7 +1,7 @@
#include "model.h"
model::model(const std::string &url, const std::string& storepath, const std::string& id, int index) : genericModel(url, id, storepath, index) {
if(!loadModel()) return;
if(!loadModel(storepath)) return;
mdl = vosk_model_new(".");
if(mdl == nullptr) {
fireEv("error", "Unable to initialize model");
@@ -9,7 +9,9 @@ model::model(const std::string &url, const std::string& storepath, const std::st
}
fireEv("ready");
};
model::~model() {
vosk_model_free(mdl);
}
bool model::checkModel() {
return fs::exists("am/final.mdl") &&
fs::exists("conf/mfcc.conf") &&