From 73c91765a5dc32e228489833a40ad5494c3034ed Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Fri, 19 Jul 2024 20:59:55 -0400 Subject: [PATCH] refactor: Update whisper model path and add flag for model loaded status --- cmake/BuildWhispercpp.cmake | 15 +-------------- src/transcription-filter-utils.cpp | 3 ++- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/cmake/BuildWhispercpp.cmake b/cmake/BuildWhispercpp.cmake index 37ef605..fc5040b 100644 --- a/cmake/BuildWhispercpp.cmake +++ b/cmake/BuildWhispercpp.cmake @@ -105,20 +105,7 @@ elseif(WIN32) # glob all dlls in the bin directory and install them file(GLOB WHISPER_DLLS ${whispercpp_fetch_SOURCE_DIR}/bin/*.dll) - foreach(FILE ${WHISPER_DLLS}) - file(RELATIVE_PATH REL_FILE ${whispercpp_fetch_SOURCE_DIR}/bin ${FILE}) - set(DEST_DIR "${CMAKE_SOURCE_DIR}/release/${CMAKE_BUILD_TYPE}/obs-plugins/64bit") - set(DEST_FILE "${DEST_DIR}/${REL_FILE}") - - if(NOT EXISTS ${DEST_DIR}) - file(MAKE_DIRECTORY ${DEST_DIR}) - endif() - - if(NOT EXISTS ${DEST_FILE} OR ${FILE} IS_NEWER_THAN ${DEST_FILE}) - message(STATUS "Copying ${FILE} to ${DEST_FILE}") - file(COPY ${FILE} DESTINATION ${DEST_DIR}) - endif() - endforeach() + install(FILES ${WHISPER_DLLS} DESTINATION "obs-plugins/64bit") else() set(Whispercpp_Build_GIT_TAG "v1.6.2") set(WHISPER_EXTRA_CXX_FLAGS "-fPIC") diff --git a/src/transcription-filter-utils.cpp b/src/transcription-filter-utils.cpp index 5c5a036..242d9c7 100644 --- a/src/transcription-filter-utils.cpp +++ b/src/transcription-filter-utils.cpp @@ -18,7 +18,7 @@ void create_obs_text_source_if_needed() obs_source_t *scene_as_source = obs_frontend_get_current_scene(); obs_scene_t *scene = obs_scene_from_source(scene_as_source); #ifdef _WIN32 - source = obs_source_create("text_gdiplus_v2", "LocalVocal Subtitles", nullptr, nullptr); + source = obs_source_create("text_gdiplus_v3", "LocalVocal Subtitles", nullptr, nullptr); #else source = obs_source_create("text_ft2_source_v2", "LocalVocal Subtitles", nullptr, nullptr); #endif @@ -64,6 +64,7 @@ bool add_sources_to_list(void *list_property, obs_source_t *source) { auto source_id = obs_source_get_id(source); if (strcmp(source_id, "text_ft2_source_v2") != 0 && + strcmp(source_id, "text_gdiplus_v3") != 0 && strcmp(source_id, "text_gdiplus_v2") != 0) { return true; }