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

@@ -1,18 +1,12 @@
#pragma once
#include "CommonModel.h"
#include <queue>
#include <emscripten/console.h>
// Prevent naming conflicts with Vosk's Recognizer class
#define Recognizer Recognizer_
struct Recognizer {
int haveData{};
bool done{};
std::atomic_bool blocker{};
int index;
std::thread t;
VoskRecognizer* rec;
std::queue<AudioData> dataQ;
Recognizer(int index, float sampleRate, CommonModel* model);