Skip to content

Commit

Permalink
refactor: Update whisper model path and add flag for model loaded status
Browse files Browse the repository at this point in the history
  • Loading branch information
royshil committed Jul 20, 2024
1 parent b3e4bfa commit 73c9176
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
15 changes: 1 addition & 14 deletions cmake/BuildWhispercpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion src/transcription-filter-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 73c9176

Please sign in to comment.