Skip to content

Commit bb1db72

Browse files
authored
Update version to 0.3.9 in README.md and buildspec.json; add availabl… (#184)
* Update version to 0.3.9 in README.md and buildspec.json; add available versions section for clarity * Add support for custom API translation provider and update configuration options * Enable ccache support in CMake build scripts for improved build performance * Add status message for detected ccache in CMake build scripts
1 parent a32e327 commit bb1db72

16 files changed

+252
-35
lines changed

.github/workflows/build-project.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ jobs:
115115
id: ccache-cache
116116
with:
117117
path: ${{ github.workspace }}/.ccache
118-
key: ${{ runner.os }}-ccache-${{ needs.check-event.outputs.config }}
118+
key: ${{ runner.os }}-ccache-${{ needs.check-event.outputs.config }}-${{ matrix.architecture }}
119119
restore-keys: |
120-
${{ runner.os }}-ccache-
120+
${{ runner.os }}-ccache-${{ matrix.architecture }}-
121121
122122
- name: Set Up Codesigning 🔑
123123
uses: ./.github/actions/setup-macos-codesigning

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
[![Discord](https://img.shields.io/discord/1200229425141252116)](https://discord.gg/KbjGU2vvUz)
1111
<br/>
1212
Download:</br>
13-
<a href="https://github.com/locaal-ai/obs-localvocal/releases/download/0.3.8/obs-localvocal-0.3.8-windows-x64-cuda-Installer.exe"><img src="https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white" /></a>
14-
<a href="https://github.com/locaal-ai/obs-localvocal/releases/download/0.3.8/obs-localvocal-0.3.8-macos-x86_64.pkg"><img src="https://img.shields.io/badge/mac%20Intel-000000?style=for-the-badge" /></a>
15-
<a href="https://github.com/locaal-ai/obs-localvocal/releases/download/0.3.8/obs-localvocal-0.3.8-macos-arm64.pkg"><img src="https://img.shields.io/badge/mac%20M1/2/3-0a0a0a?style=for-the-badge&"/></a>
16-
<a href="https://github.com/locaal-ai/obs-localvocal/releases/download/0.3.8/obs-localvocal-0.3.8-x86_64-linux-gnu.deb"><img src="https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black"/></a>
13+
<a href="https://github.com/locaal-ai/obs-localvocal/releases/download/0.3.9/obs-localvocal-0.3.9-windows-x64-cuda-Installer.exe"><img src="https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white" /></a>
14+
<a href="https://github.com/locaal-ai/obs-localvocal/releases/download/0.3.9/obs-localvocal-0.3.9-macos-x86_64.pkg"><img src="https://img.shields.io/badge/mac%20Intel-000000?style=for-the-badge" /></a>
15+
<a href="https://github.com/locaal-ai/obs-localvocal/releases/download/0.3.9/obs-localvocal-0.3.9-macos-arm64.pkg"><img src="https://img.shields.io/badge/mac%20M1/2/3-0a0a0a?style=for-the-badge&"/></a>
16+
<a href="https://github.com/locaal-ai/obs-localvocal/releases/download/0.3.9/obs-localvocal-0.3.9-x86_64-linux-gnu.deb"><img src="https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black"/></a>
1717

1818

1919
</div>
@@ -85,6 +85,20 @@ Check out our other plugins:
8585
## Download
8686
Check out the [latest releases](https://github.com/locaal-ai/obs-localvocal/releases) for downloads and install instructions.
8787

88+
### Available Versions
89+
90+
LocalVocal is available in multiple versions to cater to different hardware configurations and operating systems. Below is a brief explanation of the different versions you can download:
91+
92+
- **Windows CUDA**: This version is optimized for systems with NVIDIA GPUs and utilizes CUDA for accelerated performance. Make sure you have the latest NVidia GPU drivers installed.
93+
- **Windows CPU**: This version is designed for systems without dedicated GPUs, running solely on the CPU.
94+
- **Windows HIPBLAS**: This version utilizes the HIP framework from AMD that accelerates computation on AMD GPUs. (⚠️ Experimental ⚠️ Please provide feedback)
95+
- **Windows Vulkan**: This version uses Vulkan for GPU-based acceleration across many vendors like NVidia, AMD, and Intel. (⚠️ Experimental ⚠️ Please provide feedback)
96+
- **macOS Intel (x86_64)**: This version is for Mac computers with Intel processors.
97+
- **macOS Apple Silicon (arm64)**: This version is optimized for Mac computers with Apple Silicon (M1, M2, etc.) processors.
98+
- **Linux x86_64**: This version is for Linux systems with x86_64 architecture.
99+
100+
Make sure to download the version that matches your system's hardware and operating system for the best performance.
101+
88102
### Models
89103
The plugin ships with the Tiny.en model, and will autonomously download other Whisper models through a dropdown.
90104
There's also an option to select an external GGML Whisper model file if you have it on disk.

buildspec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"name": "obs-localvocal",
4040
"displayName": "OBS Localvocal",
41-
"version": "0.3.8",
41+
"version": "0.3.9",
4242
"author": "Roy Shilkrot",
4343
"website": "https://github.com/locaal-ai/obs-localvocal",
4444
"email": "[email protected]",

cmake/BuildCTranslate2.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ elseif(WIN32)
5050
file(GLOB CT2_DLLS ${ctranslate2_fetch_SOURCE_DIR}/bin/*.dll)
5151
install(FILES ${CT2_DLLS} DESTINATION "obs-plugins/64bit")
5252
else()
53+
# Enable ccache if available
54+
find_program(CCACHE_PROGRAM ccache)
55+
if(CCACHE_PROGRAM)
56+
message(STATUS "Found ccache: ${CCACHE_PROGRAM}")
57+
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
58+
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
59+
endif()
60+
5361
# build cpu_features from source
5462
set(CPU_FEATURES_VERSION "0.9.0")
5563
set(CPU_FEATURES_URL "https://github.com/google/cpu_features.git")

cmake/BuildSentencepiece.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ elseif(WIN32)
2727

2828
else()
2929

30+
# Enable ccache if available
31+
find_program(CCACHE_PROGRAM ccache)
32+
if(CCACHE_PROGRAM)
33+
message(STATUS "Found ccache: ${CCACHE_PROGRAM}")
34+
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
35+
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
36+
endif()
37+
3038
set(SP_URL
3139
"https://github.com/google/sentencepiece.git"
3240
CACHE STRING "URL of sentencepiece repository")

cmake/BuildWhispercpp.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ elseif(WIN32)
102102
file(GLOB WHISPER_DLLS ${whispercpp_fetch_SOURCE_DIR}/bin/*.dll)
103103
install(FILES ${WHISPER_DLLS} DESTINATION "obs-plugins/64bit")
104104
else()
105+
# Enable ccache if available
106+
find_program(CCACHE_PROGRAM ccache)
107+
if(CCACHE_PROGRAM)
108+
message(STATUS "Found ccache: ${CCACHE_PROGRAM}")
109+
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
110+
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
111+
endif()
112+
105113
if(${CMAKE_BUILD_TYPE} STREQUAL Release OR ${CMAKE_BUILD_TYPE} STREQUAL RelWithDebInfo)
106114
set(Whispercpp_BUILD_TYPE Release)
107115
else()

data/locale/en-US.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,8 @@ Deepl-Translate="Deepl"
131131
Bing-Translate="Bing Translate"
132132
OpenAI-Translate="OpenAI"
133133
Claude-Translate="Claude"
134+
API-Translate="Custom API"
134135
translate_cloud_deepl_free="Use Deepl Free API Endpoint"
136+
translate_cloud_endpoint="API Endpoint"
137+
translate_cloud_body="API Body"
138+
translate_cloud_response_json_path="Response JSON Path"

src/transcription-filter-callbacks.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,17 @@ void send_sentence_to_cloud_translation_async(const std::string &sentence,
9191
gf->last_text_for_cloud_translation = sentence;
9292
if (gf->translate_cloud && !sentence.empty()) {
9393
obs_log(gf->log_level, "Translating text with cloud provider %s. %s -> %s",
94-
gf->translate_cloud_provider.c_str(), source_language.c_str(),
94+
gf->translate_cloud_config.provider.c_str(),
95+
source_language.c_str(),
9596
gf->translate_cloud_target_language.c_str());
9697
std::string translated_text;
9798
if (sentence == last_text) {
9899
// do not translate the same sentence twice
99100
callback(gf->last_text_cloud_translation);
100101
return;
101102
}
102-
CloudTranslatorConfig config;
103-
config.provider = gf->translate_cloud_provider;
104-
config.access_key = gf->translate_cloud_api_key;
105-
config.secret_key = gf->translate_cloud_secret_key;
106-
config.free = gf->translate_cloud_deepl_free;
107-
config.region = gf->translate_cloud_region;
108-
109-
translated_text = translate_cloud(config, sentence,
103+
104+
translated_text = translate_cloud(gf->translate_cloud_config, sentence,
110105
gf->translate_cloud_target_language,
111106
source_language);
112107
if (!translated_text.empty()) {

src/transcription-filter-data.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "whisper-utils/silero-vad-onnx.h"
2020
#include "whisper-utils/whisper-processing.h"
2121
#include "whisper-utils/token-buffer-thread.h"
22+
#include "translation/cloud-translation/translation-cloud.h"
2223

2324
#define MAX_PREPROC_CHANNELS 10
2425

@@ -92,16 +93,12 @@ struct transcription_filter_data {
9293

9394
// Cloud translation options
9495
bool translate_cloud = false;
95-
std::string translate_cloud_provider;
96+
CloudTranslatorConfig translate_cloud_config;
9697
std::string translate_cloud_target_language;
9798
std::string translate_cloud_output;
98-
std::string translate_cloud_api_key;
99-
std::string translate_cloud_secret_key;
10099
bool translate_cloud_only_full_sentences = true;
101100
std::string last_text_for_cloud_translation;
102101
std::string last_text_cloud_translation;
103-
bool translate_cloud_deepl_free;
104-
std::string translate_cloud_region;
105102

106103
// Transcription context sentences
107104
int n_context_sentences;

src/transcription-filter-properties.cpp

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ bool translation_cloud_provider_selection_callback(obs_properties_t *props, obs_
5050
{
5151
UNUSED_PARAMETER(p);
5252
const char *provider = obs_data_get_string(s, "translate_cloud_provider");
53+
// show the access key for all except the custom provider
54+
obs_property_set_visible(obs_properties_get(props, "translate_cloud_api_key"),
55+
strcmp(provider, "api") != 0);
5356
obs_property_set_visible(obs_properties_get(props, "translate_cloud_deepl_free"),
5457
strcmp(provider, "deepl") == 0);
5558
// show the secret key input for the papago provider only
@@ -58,6 +61,14 @@ bool translation_cloud_provider_selection_callback(obs_properties_t *props, obs_
5861
// show the region input for the azure provider only
5962
obs_property_set_visible(obs_properties_get(props, "translate_cloud_region"),
6063
strcmp(provider, "azure") == 0);
64+
// show the endpoint and body input for the custom provider only
65+
obs_property_set_visible(obs_properties_get(props, "translate_cloud_endpoint"),
66+
strcmp(provider, "api") == 0);
67+
obs_property_set_visible(obs_properties_get(props, "translate_cloud_body"),
68+
strcmp(provider, "api") == 0);
69+
// show the response json path input for the custom provider only
70+
obs_property_set_visible(obs_properties_get(props, "translate_cloud_response_json_path"),
71+
strcmp(provider, "api") == 0);
6172
return true;
6273
}
6374

@@ -67,10 +78,12 @@ bool translation_cloud_options_callback(obs_properties_t *props, obs_property_t
6778
UNUSED_PARAMETER(property);
6879
// Show/Hide the cloud translation group options
6980
const bool translate_enabled = obs_data_get_bool(settings, "translate_cloud");
70-
for (const auto &prop : {"translate_cloud_provider", "translate_cloud_target_language",
71-
"translate_cloud_output", "translate_cloud_api_key",
72-
"translate_cloud_only_full_sentences",
73-
"translate_cloud_secret_key", "translate_cloud_deepl_free"}) {
81+
for (const auto &prop :
82+
{"translate_cloud_provider", "translate_cloud_target_language",
83+
"translate_cloud_output", "translate_cloud_api_key",
84+
"translate_cloud_only_full_sentences", "translate_cloud_secret_key",
85+
"translate_cloud_deepl_free", "translate_cloud_region", "translate_cloud_endpoint",
86+
"translate_cloud_body", "translate_cloud_response_json_path"}) {
7487
obs_property_set_visible(obs_properties_get(props, prop), translate_enabled);
7588
}
7689
if (translate_enabled) {
@@ -259,6 +272,7 @@ void add_translation_cloud_group_properties(obs_properties_t *ppts)
259272
"openai");
260273
obs_property_list_add_string(prop_translate_cloud_provider, MT_("Claude-Translate"),
261274
"claude");
275+
obs_property_list_add_string(prop_translate_cloud_provider, MT_("API-Translate"), "api");
262276

263277
// add callback to show/hide the free API option for deepl
264278
obs_property_set_modified_callback(prop_translate_cloud_provider,
@@ -298,6 +312,16 @@ void add_translation_cloud_group_properties(obs_properties_t *ppts)
298312
// add translate_cloud_region for azure
299313
obs_properties_add_text(translation_cloud_group, "translate_cloud_region",
300314
MT_("translate_cloud_region"), OBS_TEXT_DEFAULT);
315+
316+
// add input for API endpoint
317+
obs_properties_add_text(translation_cloud_group, "translate_cloud_endpoint",
318+
MT_("translate_cloud_endpoint"), OBS_TEXT_DEFAULT);
319+
// add input for API body
320+
obs_properties_add_text(translation_cloud_group, "translate_cloud_body",
321+
MT_("translate_cloud_body"), OBS_TEXT_MULTILINE);
322+
// add input for json response path
323+
obs_properties_add_text(translation_cloud_group, "translate_cloud_response_json_path",
324+
MT_("translate_cloud_response_json_path"), OBS_TEXT_DEFAULT);
301325
}
302326

303327
void add_translation_group_properties(obs_properties_t *ppts)
@@ -667,6 +691,12 @@ void transcription_filter_defaults(obs_data_t *s)
667691
obs_data_set_default_string(s, "translate_cloud_secret_key", "");
668692
obs_data_set_default_bool(s, "translate_cloud_deepl_free", true);
669693
obs_data_set_default_string(s, "translate_cloud_region", "eastus");
694+
obs_data_set_default_string(s, "translate_cloud_endpoint",
695+
"http://localhost:5000/translate");
696+
obs_data_set_default_string(
697+
s, "translate_cloud_body",
698+
"{\n\t\"text\":\"{{sentence}}\",\n\t\"target\":\"{{target_language}}\"\n}");
699+
obs_data_set_default_string(s, "translate_cloud_response_json_path", "translations.0.text");
670700

671701
// Whisper parameters
672702
apply_whisper_params_defaults_on_settings(s);

0 commit comments

Comments
 (0)