Recognizer deleteion safety + data control, remove repeating UTF8ToString() call from event system.

This commit is contained in:
msqr1
2024-09-02 23:02:06 -07:00
parent 070fc73126
commit b0f8464eeb
15 changed files with 136 additions and 102 deletions

View File

@@ -13,6 +13,14 @@ struct AudioData {
int len;
AudioData(int start, int len) : data{reinterpret_cast<float*>(start)}, len{len} {}
};
enum Event {
// Shared
status,
// Recognizer
partialResult,
result,
};
enum UntarStatus {
Successful,
IncorrectFormat,
@@ -39,7 +47,7 @@ struct WorkerPool {
~WorkerPool();
void exec(std::function<void()> fn);
};
void fireEv(int index, const char* _content, const char* _type = nullptr);
void fireEv(int index, int typeIdx, const char* content = nullptr);
int untar(unsigned char* tar, int tarSize, const std::string& storepath);
extern WorkerPool globalPool;