diff --git a/examples/wchess/libwchess/WChess.h b/examples/wchess/libwchess/WChess.h index 994d7a3b..2c89518e 100644 --- a/examples/wchess/libwchess/WChess.h +++ b/examples/wchess/libwchess/WChess.h @@ -26,8 +26,8 @@ public: int32_t vad_ms = 2000; int32_t prompt_ms = 5000; int32_t command_ms = 4000; - float vad_thold = 0.1f; - float freq_thold = -1.0f; + float vad_thold = 0.2f; + float freq_thold = 100.0f; bool print_energy = false; }; diff --git a/examples/wchess/wchess.wasm/wchess.wasm.cpp b/examples/wchess/wchess.wasm/wchess.wasm.cpp index 6a815958..6ce27464 100644 --- a/examples/wchess/wchess.wasm/wchess.wasm.cpp +++ b/examples/wchess/wchess.wasm/wchess.wasm.cpp @@ -44,10 +44,15 @@ void get_audio(int ms, std::vector & audio) { } bool check_running() { - g_pcmf32.clear(); + //g_pcmf32.clear(); return g_running; } +bool clear_audio() { + g_pcmf32.clear(); + return true; +} + void wchess_main(size_t i) { struct whisper_full_params wparams = whisper_full_default_params(whisper_sampling_strategy::WHISPER_SAMPLING_GREEDY); @@ -81,6 +86,7 @@ void wchess_main(size_t i) { cb.check_running = check_running; cb.get_audio = get_audio; cb.set_moves = set_moves; + cb.clear_audio = clear_audio; WChess(g_contexts[i], wparams, cb, {}).run(); if (i < g_contexts.size()) {