Change base structure to use errors instead

This commit is contained in:
msqr1
2024-01-20 00:41:38 -08:00
parent 91a21271d5
commit 2a426b983c
19 changed files with 147 additions and 198 deletions

View File

@@ -1,13 +1,12 @@
#include "model.h"
model::model(const std::string &url, const std::string& storepath, const std::string& id, int index) : genericModel(url, id, storepath, index) {
model::model(const std::string &url, const std::string& storepath, const std::string& id, int index) : genericModel(url, id, storepath) {
if(!loadModel(storepath)) return;
mdl = vosk_model_new(".");
if(mdl == nullptr) {
fireEv("error", "Unable to initialize model");
throwErr("Unable to initialize model");
return;
}
fireEv("ready");
};
model::~model() {
vosk_model_free(mdl);