Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix(stt): fail configure if the patched whisper.cpp is not compiled; read the harness port from the helper env

EtienneLescot04b7d15ac28f
diff --git a/electron/native/whisper-stt/CMakeLists.txt b/electron/native/whisper-stt/CMakeLists.txt
index c634316ce..0f6f358da 100644
--- a/electron/native/whisper-stt/CMakeLists.txt
+++ b/electron/native/whisper-stt/CMakeLists.txt
@@ -174,6 +174,9 @@ configure_file("${CMAKE_CURRENT_BINARY_DIR}/whisper-patched/whisper.cpp.tmp"
"${CMAKE_CURRENT_BINARY_DIR}/whisper-patched/whisper.cpp" COPYONLY)
get_target_property(osc_whisper_srcs whisper SOURCES)
list(TRANSFORM osc_whisper_srcs REPLACE "^whisper\\.cpp$" "${CMAKE_CURRENT_BINARY_DIR}/whisper-patched/whisper.cpp")
+if(NOT "${CMAKE_CURRENT_BINARY_DIR}/whisper-patched/whisper.cpp" IN_LIST osc_whisper_srcs)
+ message(FATAL_ERROR "char-dtw: the whisper target does not list whisper.cpp as expected (${osc_whisper_srcs})")
+endif()
set_property(TARGET whisper PROPERTY SOURCES ${osc_whisper_srcs})
add_executable(whisper-stt-server src/main.cpp)
diff --git a/tools/stt-eval/word-timing/lib.mjs b/tools/stt-eval/word-timing/lib.mjs
index 85cda97f9..5c163a581 100644
--- a/tools/stt-eval/word-timing/lib.mjs
+++ b/tools/stt-eval/word-timing/lib.mjs
@@ -27,7 +27,7 @@ export const SR = 16000;
* 20500-20599 (OSC_WORD_TIMING_PORT moves the range) and waits until it answers. The process is killed on exit.
*/
export async function startHelper(exe, { cpu = false, env = process.env } = {}) {
- const port = Number(process.env.OSC_WORD_TIMING_PORT ?? 20500) + Math.floor(Math.random() * 100);
+ const port = Number(env.OSC_WORD_TIMING_PORT ?? 20500) + Math.floor(Math.random() * 100);
const args = [
"--model",
path.join(MODELS, "ggml-small-q8_0.bin"),