Remodel threading to use a global thread pool so it never block on the main thread. Bump emscripten to 3.1.65

This commit is contained in:
msqr1
2024-08-26 22:37:35 -07:00
parent 53262fe7f3
commit c4ff62fa31
14 changed files with 111 additions and 81 deletions

View File

@@ -2,17 +2,12 @@
#include "Util.h"
#include <vosk_api.h>
extern void free(void*);
struct CommonModel {
bool normalMdl;
std::atomic_bool thrdUsed{};
int index;
std::thread t;
std::function<void()> recognizerMain;
std::string storepath;
std::string id;
std::variant<VoskModel*, VoskSpkModel*> mdl;
void extractAndLoad(unsigned char* tarStart, int tarSize);
int findWord(std::string word);
CommonModel(int index, bool normalMdl, std::string storepath, std::string id, int tarStart, int tarSize);