Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"whisper_vad_silence": "VAD Silence",
"whisper_silence_note": "Duration in ms to wait for to detect end of speech segment. Default: 240",
"whisper_use_gpu": "GPU Acceleration",
"whisper_speaking_prompt": "Toggle Speaking Prompt",

"deepgram_title": "Deepgram",
"deepgram_key": "Key",
Expand Down
9 changes: 9 additions & 0 deletions public/i18n/zh_cn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@
"speechly_title": "Speechly",
"speechly_appid": "App ID",

"whisper_title": "Whisper",
"whisper_model_path": "Whisper 模型",
"whisper_translate_to_english": "翻译为英文",
"whisper_lang_desc_note": "注意:质量因选择的语言和模型而异",
"whisper_vad_silence": "VAD 静音",
"whisper_silence_note": "等待检测语音段落结尾的毫秒数。默认值:240",
"whisper_use_gpu": "GPU 加速",
"whisper_speaking_prompt": "切换说话提示",

"deepgram_title": "Deepgram",
"deepgram_key": "Key",
"deepgram_quality": "质量",
Expand Down
9 changes: 9 additions & 0 deletions public/i18n/zh_tw/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@
"speechly_title": "Speechly",
"speechly_appid": "App ID",

"whisper_title": "Whisper",
"whisper_model_path": "Whisper 模型",
"whisper_translate_to_english": "翻譯為英文",
"whisper_lang_desc_note": "注意:質量因選擇的語言和模型而異",
"whisper_vad_silence": "VAD 靜音",
"whisper_silence_note": "等待檢測語音段落結尾的毫秒數。默認值:240",
"whisper_use_gpu": "GPU 加速",
"whisper_speaking_prompt": "切換說話提示",

"deepgram_title": "Deepgram",
"deepgram_key": "Key",
"deepgram_quality": "質量",
Expand Down
4 changes: 3 additions & 1 deletion src-tauri/src/services/whisper_stt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub struct WhisperArgs {
translate_to_english: bool,
silence_interval: u64,
use_gpu: bool,
show_speaking_prompt: bool,
}

pub fn init<R: Runtime>() -> plugin::TauriPlugin<R> {
Expand Down Expand Up @@ -200,7 +201,8 @@ pub async fn start<R: Runtime>(app: AppHandle<R>, args: WhisperArgs) -> Result<(
event = activity_rx.next() => {
match event {
Some(VadActivity::SpeechStart) => {
if app.emit("whisper_stt_interim", "[speaking]").is_err() {
let interim_text = if args.show_speaking_prompt { "[speaking]" } else { "" };
if app.emit("whisper_stt_interim", interim_text).is_err() {
eprintln!("wasn't able to emit to frontend {}:{}", file!(), line!());
}
},
Expand Down
1 change: 1 addition & 0 deletions src/server/services/stt/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const Service_STT_Schema = z.object({
translateToEnglish: zSafe(z.coerce.boolean(), false),
silenceInterval: zSafe(zStringNumber(), "240"),
useGpu: zSafe(z.coerce.boolean(), true),
showSpeakingPrompt: zSafe(z.coerce.boolean(), true),
}).default({}),
deepgram: z.object({
device: zSafe(z.coerce.string(), "default"),
Expand Down
1 change: 1 addition & 0 deletions src/server/services/stt/services/whisper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class STT_WhisperService implements ISTTService {
translateToEnglish: this.state.translateToEnglish,
silenceInterval: parseInt(this.state.silenceInterval),
useGpu: this.state.useGpu,
showSpeakingPrompt: this.state.showSpeakingPrompt,
},
}).catch(err => {
this.#initialized = false;
Expand Down
1 change: 1 addition & 0 deletions src/server/ui/inspector/inspector_stt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ const Whisper: FC = () => {
<InputRange label="stt.whisper_vad_silence" step="30" min="120" max="2000" value={data.silenceInterval} onChange={e => handleUpdate("silenceInterval", e.target.value)} />
<Inspector.Description>{t('stt.whisper_silence_note')}</Inspector.Description>
<InputCheckbox label="stt.whisper_use_gpu" onChange={e => handleUpdate("useGpu", e)} value={data.useGpu}/>
<InputCheckbox label="stt.whisper_speaking_prompt" onChange={e => handleUpdate("showSpeakingPrompt", e)} value={data.showSpeakingPrompt}/>
<InputFilePath
label="stt.whisper_model_path"
value={data.modelPath}
Expand Down
Loading