Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

Expose controls for VAD settings from Solero (#718)

perry2of52ea4af18e86d
diff --git a/package.json b/package.json
index 65febeec5..31be40a2d 100644
--- a/package.json
+++ b/package.json
@@ -20,33 +20,33 @@
"compile:mic-listener": "node scripts/build-macos-mic-listener.js",
"compile:audio-tap": "node scripts/build-macos-audio-tap.js",
"compile:native": "npm run compile:globe && npm run compile:fast-paste && npm run compile:winkeys && npm run compile:linuxkeys && npm run compile:winpaste && npm run compile:linux-paste && npm run compile:linux-system-audio && npm run compile:text-monitor && npm run compile:media-remote && npm run compile:mic-listener && npm run compile:audio-tap",
- "prestart": "npm run compile:native && npm run download:meeting-aec-helper && npm run download:qdrant && npm run download:embedding-model",
+ "prestart": "npm run compile:native && npm run download:meeting-aec-helper && npm run download:qdrant && npm run download:embedding-model && npm run download:whisper-vad-model",
"start": "electron .",
- "predev": "npm run compile:native && npm run download:meeting-aec-helper && npm run download:qdrant && npm run download:embedding-model",
+ "predev": "npm run compile:native && npm run download:meeting-aec-helper && npm run download:qdrant && npm run download:embedding-model && npm run download:whisper-vad-model",
"dev": "concurrently -k -r \"npm:dev:renderer\" \"npm:dev:main\"",
- "predev:main": "npm run compile:native && npm run download:meeting-aec-helper && npm run download:qdrant && npm run download:embedding-model",
+ "predev:main": "npm run compile:native && npm run download:meeting-aec-helper && npm run download:qdrant && npm run download:embedding-model && npm run download:whisper-vad-model",
"dev:main": "cross-env NODE_ENV=development node scripts/run-electron.js --dev",
"dev:renderer": "cd src && vite",
- "prebuild": "npm run compile:native && npm run download:whisper-cpp && npm run download:llama-server && npm run download:sherpa-onnx && npm run download:qdrant && npm run download:meeting-aec-helper && npm run download:embedding-model -- --for-build && npm run download:diarization-models -- --output-dir resources/bin/diarization-models",
+ "prebuild": "npm run compile:native && npm run download:whisper-cpp && npm run download:llama-server && npm run download:sherpa-onnx && npm run download:qdrant && npm run download:meeting-aec-helper && npm run download:whisper-vad-model && npm run download:embedding-model -- --for-build && npm run download:diarization-models -- --output-dir resources/bin/diarization-models",
"build": "cd src && vite build && cd .. && electron-builder",
"postinstall": "electron-builder install-app-deps",
"build:renderer": "cd src && vite build",
"compile:mac-icon": "node scripts/compile-macos-icon.js",
- "prebuild:mac": "npm run compile:native && npm run compile:mac-icon && npm run download:whisper-cpp && npm run download:llama-server && npm run download:sherpa-onnx && npm run download:qdrant && npm run download:meeting-aec-helper && npm run download:diarization-models -- --output-dir resources/bin/diarization-models",
+ "prebuild:mac": "npm run compile:native && npm run compile:mac-icon && npm run download:whisper-cpp && npm run download:llama-server && npm run download:sherpa-onnx && npm run download:qdrant && npm run download:meeting-aec-helper && npm run download:whisper-vad-model && npm run download:diarization-models -- --output-dir resources/bin/diarization-models",
"build:mac": "npm run build:renderer && electron-builder --mac",
"build:mac:arm64": "npm run build:renderer && electron-builder --mac --arm64",
"build:mac:x64": "npm run build:renderer && electron-builder --mac --x64",
- "prebuild:win": "npm run compile:native && npm run download:whisper-cpp && npm run download:llama-server && npm run download:sherpa-onnx && npm run download:qdrant && npm run download:meeting-aec-helper && npm run download:diarization-models -- --output-dir resources/bin/diarization-models && npm run download:nircmd && npm run download:windows-fast-paste && npm run download:windows-key-listener && npm run download:windows-mic-listener",
+ "prebuild:win": "npm run compile:native && npm run download:whisper-cpp && npm run download:llama-server && npm run download:sherpa-onnx && npm run download:qdrant && npm run download:meeting-aec-helper && npm run download:whisper-vad-model && npm run download:diarization-models -- --output-dir resources/bin/diarization-models && npm run download:nircmd && npm run download:windows-fast-paste && npm run download:windows-key-listener && npm run download:windows-mic-listener",
"build:win": "npm run build:renderer && electron-builder --win",
- "prebuild:linux": "npm run compile:native && npm run download:whisper-cpp && npm run download:llama-server && npm run download:sherpa-onnx && npm run download:qdrant && npm run download:meeting-aec-helper && npm run download:diarization-models -- --output-dir resources/bin/diarization-models",
+ "prebuild:linux": "npm run compile:native && npm run download:whisper-cpp && npm run download:llama-server && npm run download:sherpa-onnx && npm run download:qdrant && npm run download:meeting-aec-helper && npm run download:whisper-vad-model && npm run download:diarization-models -- --output-dir resources/bin/diarization-models",
"build:linux": "npm run build:renderer && electron-builder --linux",
"build:linux:appimage": "npm run build:renderer && electron-builder --linux AppImage",
"build:linux:deb": "npm run build:renderer && electron-builder --linux deb",
"build:linux:rpm": "npm run build:renderer && electron-builder --linux rpm",
"build:linux:tar": "npm run build:renderer && electron-builder --linux tar.gz",
- "prepack": "npm run compile:native && npm run download:whisper-cpp && npm run download:llama-server && npm run download:sherpa-onnx && npm run download:qdrant && npm run download:meeting-aec-helper && npm run download:diarization-models -- --output-dir resources/bin/diarization-models",
+ "prepack": "npm run compile:native && npm run download:whisper-cpp && npm run download:llama-server && npm run download:sherpa-onnx && npm run download:qdrant && npm run download:meeting-aec-helper && npm run download:whisper-vad-model && npm run download:diarization-models -- --output-dir resources/bin/diarization-models",
"pack": "npm run build:renderer && cross-env CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --dir",
- "predist": "npm run compile:native && npm run download:whisper-cpp && npm run download:llama-server && npm run download:sherpa-onnx && npm run download:qdrant && npm run download:meeting-aec-helper && npm run download:diarization-models -- --output-dir resources/bin/diarization-models",
+ "predist": "npm run compile:native && npm run download:whisper-cpp && npm run download:llama-server && npm run download:sherpa-onnx && npm run download:qdrant && npm run download:meeting-aec-helper && npm run download:whisper-vad-model && npm run download:diarization-models -- --output-dir resources/bin/diarization-models",
"dist": "npm run build:renderer && electron-builder",
"download:whisper-cpp": "node scripts/download-whisper-cpp.js --current",
"download:whisper-cpp:all": "node scripts/download-whisper-cpp.js --all",
@@ -64,6 +64,7 @@
"download:qdrant:all": "node scripts/download-qdrant.js --all",
"download:embedding-model": "node scripts/download-minilm.js",
"download:diarization-models": "node scripts/download-diarization-models.js",
+ "download:whisper-vad-model": "node scripts/download-whisper-vad-model.js",
"format:js": "eslint . --fix && cd src && eslint . --fix && prettier --write \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
"format": "npm run format:js",
"format:check": "eslint . && cd src && eslint . && prettier --check \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
diff --git a/preload.js b/preload.js
index dad763bf3..e2c7aab8e 100644
--- a/preload.js
+++ b/preload.js
@@ -843,6 +843,8 @@ contextBridge.exposeInMainWorld("electronAPI", {
ipcRenderer.invoke("meeting-set-speaker-diarization-enabled", { enabled }),
setMeetingSessionSpeakerConfig: (config) =>
ipcRenderer.invoke("meeting-set-session-speaker-config", config),
+ getWhisperVadConfig: () => ipcRenderer.invoke("whisper-vad-get-config"),
+ setWhisperVadConfig: (config) => ipcRenderer.invoke("whisper-vad-set-config", config),
onMeetingDetected: registerListener(
"meeting-detected",
(callback) => (_event, data) => callback(data)
diff --git a/scripts/download-whisper-vad-model.js b/scripts/download-whisper-vad-model.js
new file mode 100644
index 000000000..d17fc3dcf
--- /dev/null
+++ b/scripts/download-whisper-vad-model.js
@@ -0,0 +1,42 @@
+#!/usr/bin/env node
+const fs = require("fs");
+const path = require("path");
+const { downloadFile, parseArgs } = require("./lib/download-utils");
+
+const VAD_MODEL_URL =
+ "https://huggingface.co/ggml-org/whisper-vad/resolve/main/ggml-silero-v5.1.2.bin";
+const VAD_MODEL_FILE = "ggml-silero-v5.1.2.bin";
+
+function getOutputDir() {
+ const outputDirIndex = process.argv.indexOf("--output-dir");
+ if (outputDirIndex !== -1 && process.argv[outputDirIndex + 1]) {
+ return path.resolve(process.argv[outputDirIndex + 1]);
+ }
+ return path.join(__dirname, "..", "resources", "bin", "whisper-vad");
+}
+
+async function main() {
+ const args = parseArgs();
+ const outputDir = getOutputDir();
+ const outputPath = path.join(outputDir, VAD_MODEL_FILE);
+
+ if (fs.existsSync(outputPath) && !args.isForce) {
+ console.log(`[whisper-vad-model] ${VAD_MODEL_FILE} already exists`);
+ return;
+ }
+
+ fs.mkdirSync(outputDir, { recursive: true });
+
+ console.log(`[whisper-vad-model] Downloading ${VAD_MODEL_FILE}`);
+ try {
+ await downloadFile(VAD_MODEL_URL, outputPath);
+ const sizeKb = Math.round(fs.statSync(outputPath).size / 1024);
+ console.log(`[whisper-vad-model] Downloaded ${VAD_MODEL_FILE} (${sizeKb}KB)`);
+ } catch (error) {
+ console.error(`[whisper-vad-model] Download failed: ${error.message}`);
+ if (fs.existsSync(outputPath)) fs.unlinkSync(outputPath);
+ process.exitCode = 1;
+ }
+}
+
+main().catch(console.error);
diff --git a/src/components/SettingsPage.tsx b/src/components/SettingsPage.tsx
index 6ea2d6adf..bad8ed258 100644
--- a/src/components/SettingsPage.tsx
+++ b/src/components/SettingsPage.tsx
@@ -29,6 +29,7 @@ import {
BookOpen,
Copy,
Trash2,
+ Info,
MessageSquare,
FileAudio,
Wand2,
@@ -89,6 +90,7 @@ import type { InferenceModeOption } from "./ui/SettingsSection";
import { useSettingsLayout } from "./ui/useSettingsLayout";
import { useUsage } from "../hooks/useUsage";
import { cn } from "./lib/utils";
+import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
import { startMigration, useMigration } from "../stores/noteStore.js";
import { syncService } from "../services/SyncService.js";
import { formatBytes } from "../utils/formatBytes";
@@ -467,6 +469,28 @@ function useSubTab<T extends string>(storageKey: string, options: readonly T[],
return [safeTab, setTab] as const;
}
+function VADLabelWithInfo({ label, description }: { label: string; description: string }) {
+ return (
+ <div className="inline-flex items-center gap-1.5 text-xs font-medium text-foreground">
+ <span>{label}</span>
+ <Popover>
+ <PopoverTrigger asChild>
+ <button
+ type="button"
+ className="inline-flex items-center justify-center rounded-sm text-muted-foreground hover:text-foreground transition-colors"
+ aria-label={label}
+ >
+ <Info className="h-3.5 w-3.5" />
+ </button>
+ </PopoverTrigger>
+ <PopoverContent side="top" align="start" className="max-w-sm p-3">
+ <p className="text-xs leading-relaxed text-muted-foreground">{description}</p>
+ </PopoverContent>
+ </Popover>
+ </div>
+ );
+}
+
function SpeechToTextTabs({
initialTab,
renderDictation,
@@ -706,6 +730,24 @@ export default function SettingsPage({
setNoteFilesEnabled,
noteFilesPath,
setNoteFilesPath,
+ dictationSileroEnabled,
+ setDictationSileroEnabled,
+ noteRecordingSileroEnabled,
+ setNoteRecordingSileroEnabled,
+ meetingSileroEnabled,
+ setMeetingSileroEnabled,
+ whisperVadThreshold,
+ setWhisperVadThreshold,
+ whisperVadMinSpeechDurationMs,
+ setWhisperVadMinSpeechDurationMs,
+ whisperVadMinSilenceDurationMs,
+ setWhisperVadMinSilenceDurationMs,
+ whisperVadMaxSpeechDurationS,
+ setWhisperVadMaxSpeechDurationS,
+ whisperVadSpeechPadMs,
+ setWhisperVadSpeechPadMs,
+ whisperVadSamplesOverlap,
+ setWhisperVadSamplesOverlap,
} = useSettings();
const chatAgentKey = useSettingsStore((s) => s.chatAgentKey);
@@ -1278,6 +1320,129 @@ export default function SettingsPage({
});
}, [showConfirmDialog, showAlertDialog, t]);
+ const renderWhisperVadSettings = () => (
+ <div>
+ <SectionHeader
+ title={t("settingsPage.transcription.vad.title")}
+ description={t("settingsPage.transcription.vad.description")}
+ />
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <SettingsRow
+ label={t("settingsPage.transcription.vad.toggles.dictation.title")}
+ description={t("settingsPage.transcription.vad.toggles.dictation.description")}
+ >
+ <Toggle checked={dictationSileroEnabled} onChange={setDictationSileroEnabled} />
+ </SettingsRow>
+ </SettingsPanelRow>
+ <SettingsPanelRow>
+ <SettingsRow
+ label={t("settingsPage.transcription.vad.toggles.noteRecording.title")}
+ description={t("settingsPage.transcription.vad.toggles.noteRecording.description")}
+ >
+ <Toggle checked={noteRecordingSileroEnabled} onChange={setNoteRecordingSileroEnabled} />
+ </SettingsRow>
+ </SettingsPanelRow>
+ <SettingsPanelRow>
+ <SettingsRow
+ label={t("settingsPage.transcription.vad.toggles.meeting.title")}
+ description={t("settingsPage.transcription.vad.toggles.meeting.description")}
+ >
+ <Toggle checked={meetingSileroEnabled} onChange={setMeetingSileroEnabled} />
+ </SettingsRow>
+ </SettingsPanelRow>
+ <SettingsPanelRow>
+ <div className="grid grid-cols-1 sm:grid-cols-2 gap-3 w-full">
+ <div className="space-y-1.5">
+ <VADLabelWithInfo
+ label={t("settingsPage.transcription.vad.fields.threshold.label")}
+ description={t("settingsPage.transcription.vad.fields.threshold.info")}
+ />
+ <Input
+ type="number"
+ step="0.01"
+ min="0.1"
+ max="0.95"
+ value={whisperVadThreshold}
+ onChange={(e) => setWhisperVadThreshold(Number(e.target.value))}
+ />
+ </div>
+ <div className="space-y-1.5">
+ <VADLabelWithInfo
+ label={t("settingsPage.transcription.vad.fields.minSpeechDurationMs.label")}
+ description={t("settingsPage.transcription.vad.fields.minSpeechDurationMs.info")}
+ />
+ <Input
+ type="number"
+ step="10"
+ min="50"
+ max="2000"
+ value={whisperVadMinSpeechDurationMs}
+ onChange={(e) => setWhisperVadMinSpeechDurationMs(Number(e.target.value))}
+ />
+ </div>
+ <div className="space-y-1.5">
+ <VADLabelWithInfo
+ label={t("settingsPage.transcription.vad.fields.minSilenceDurationMs.label")}
+ description={t("settingsPage.transcription.vad.fields.minSilenceDurationMs.info")}
+ />
+ <Input
+ type="number"
+ step="10"
+ min="50"
+ max="2000"
+ value={whisperVadMinSilenceDurationMs}
+ onChange={(e) => setWhisperVadMinSilenceDurationMs(Number(e.target.value))}
+ />
+ </div>
+ <div className="space-y-1.5">
+ <VADLabelWithInfo
+ label={t("settingsPage.transcription.vad.fields.maxSpeechDurationS.label")}
+ description={t("settingsPage.transcription.vad.fields.maxSpeechDurationS.info")}
+ />
+ <Input
+ type="number"
+ step="1"
+ min="5"
+ max="120"
+ value={whisperVadMaxSpeechDurationS}
+ onChange={(e) => setWhisperVadMaxSpeechDurationS(Number(e.target.value))}
+ />
+ </div>
+ <div className="space-y-1.5">
+ <VADLabelWithInfo
+ label={t("settingsPage.transcription.vad.fields.speechPadMs.label")}
+ description={t("settingsPage.transcription.vad.fields.speechPadMs.info")}
+ />
+ <Input
+ type="number"
+ step="10"
+ min="0"
+ max="1000"
+ value={whisperVadSpeechPadMs}
+ onChange={(e) => setWhisperVadSpeechPadMs(Number(e.target.value))}
+ />
+ </div>
+ <div className="space-y-1.5">
+ <VADLabelWithInfo
+ label={t("settingsPage.transcription.vad.fields.samplesOverlap.label")}
+ description={t("settingsPage.transcription.vad.fields.samplesOverlap.info")}
+ />
+ <Input
+ type="number"
+ step="0.01"
+ min="0"
+ max="0.95"
+ value={whisperVadSamplesOverlap}
+ onChange={(e) => setWhisperVadSamplesOverlap(Number(e.target.value))}
+ />
+ </div>
+ </div>
+ </SettingsPanelRow>
+ </SettingsPanel>
+ </div>
+ );
+
const renderSectionContent = () => {
switch (activeSection) {
case "account":
@@ -3019,36 +3184,48 @@ EOF`,
<SpeechToTextTabs
initialTab={initialSubTab as SpeechTab | undefined}
renderDictation={() => (
- <TranscriptionSection
- isSignedIn={isSignedIn ?? false}
- startOnboarding={startOnboarding}
- cloudTranscriptionMode={cloudTranscriptionMode}
- setCloudTranscriptionMode={setCloudTranscriptionMode}
- useLocalWhisper={useLocalWhisper}
- setUseLocalWhisper={setUseLocalWhisper}
- updateTranscriptionSettings={updateTranscriptionSettings}
- cloudTranscriptionProvider={cloudTranscriptionProvider}
- setCloudTranscriptionProvider={setCloudTranscriptionProvider}
- cloudTranscriptionModel={cloudTranscriptionModel}
- setCloudTranscriptionModel={setCloudTranscriptionModel}
- localTranscriptionProvider={localTranscriptionProvider}
- setLocalTranscriptionProvider={setLocalTranscriptionProvider}
- whisperModel={whisperModel}
- setWhisperModel={setWhisperModel}
- parakeetModel={parakeetModel}
- setParakeetModel={setParakeetModel}
- cloudTranscriptionBaseUrl={cloudTranscriptionBaseUrl}
- setCloudTranscriptionBaseUrl={setCloudTranscriptionBaseUrl}
- transcriptionMode={transcriptionMode}
- setTranscriptionMode={setTranscriptionMode}
- remoteTranscriptionUrl={remoteTranscriptionUrl}
- setRemoteTranscriptionUrl={setRemoteTranscriptionUrl}
- showTranscriptionPreview={showTranscriptionPreview}
- setShowTranscriptionPreview={setShowTranscriptionPreview}
- toast={toast}
- />
+ <div className="space-y-6">
+ <TranscriptionSection
+ isSignedIn={isSignedIn ?? false}
+ startOnboarding={startOnboarding}
+ cloudTranscriptionMode={cloudTranscriptionMode}
+ setCloudTranscriptionMode={setCloudTranscriptionMode}
+ useLocalWhisper={useLocalWhisper}
+ setUseLocalWhisper={setUseLocalWhisper}
+ updateTranscriptionSettings={updateTranscriptionSettings}
+ cloudTranscriptionProvider={cloudTranscriptionProvider}
+ setCloudTranscriptionProvider={setCloudTranscriptionProvider}
+ cloudTranscriptionModel={cloudTranscriptionModel}
+ setCloudTranscriptionModel={setCloudTranscriptionModel}
+ localTranscriptionProvider={localTranscriptionProvider}
+ setLocalTranscriptionProvider={setLocalTranscriptionProvider}
+ whisperModel={whisperModel}
+ setWhisperModel={setWhisperModel}
+ parakeetModel={parakeetModel}
+ setParakeetModel={setParakeetModel}
+ cloudTranscriptionBaseUrl={cloudTranscriptionBaseUrl}
+ setCloudTranscriptionBaseUrl={setCloudTranscriptionBaseUrl}
+ transcriptionMode={transcriptionMode}
+ setTranscriptionMode={setTranscriptionMode}
+ remoteTranscriptionUrl={remoteTranscriptionUrl}
+ setRemoteTranscriptionUrl={setRemoteTranscriptionUrl}
+ showTranscriptionPreview={showTranscriptionPreview}
+ setShowTranscriptionPreview={setShowTranscriptionPreview}
+ toast={toast}
+ />
+ {transcriptionMode === "local" &&
+ localTranscriptionProvider !== "nvidia" &&
+ renderWhisperVadSettings()}
+ </div>
+ )}
+ renderNoteRecording={() => (
+ <div className="space-y-6">
+ <MeetingTranscriptionPanel />
+ {transcriptionMode === "local" &&
+ localTranscriptionProvider !== "nvidia" &&
+ renderWhisperVadSettings()}
+ </div>
)}
- renderNoteRecording={() => <MeetingTranscriptionPanel />}
/>
);
diff --git a/src/components/notes/BackgroundActionToastListener.tsx b/src/components/notes/BackgroundActionToastListener.tsx
index a9b42e13e..f61ac34a6 100644
--- a/src/components/notes/BackgroundActionToastListener.tsx
+++ b/src/components/notes/BackgroundActionToastListener.tsx
@@ -1,10 +1,7 @@
import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { useToast } from "../ui/useToast";
-import {
- useActionProcessingStore,
- consumeErrorEvents,
-} from "../../stores/actionProcessingStore";
+import { useActionProcessingStore, consumeErrorEvents } from "../../stores/actionProcessingStore";
/**
* Headless. Mount once inside ToastProvider so background-action errors
diff --git a/src/components/notes/UploadAudioView.tsx b/src/components/notes/UploadAudioView.tsx
index 560b9fa24..f8bf05f5b 100644
--- a/src/components/notes/UploadAudioView.tsx
+++ b/src/components/notes/UploadAudioView.tsx
@@ -31,7 +31,11 @@ import { useUsage } from "../../hooks/useUsage";
import { useSettings } from "../../hooks/useSettings";
import { withSessionRefresh } from "../../lib/auth";
import { getAllReasoningModels } from "../../models/ModelRegistry";
-import { useSettingsStore, selectIsCloudCleanupMode, getSettings } from "../../stores/settingsStore";
+import {
+ useSettingsStore,
+ selectIsCloudCleanupMode,
+ getSettings,
+} from "../../stores/settingsStore";
import { generateNoteTitle } from "../../utils/generateTitle";
const TranscriptionModelPicker = React.lazy(() => import("../TranscriptionModelPicker"));
diff --git a/src/constants/whisperVad.json b/src/constants/whisperVad.json
new file mode 100644
index 000000000..3404c38bd
--- /dev/null
+++ b/src/constants/whisperVad.json
@@ -0,0 +1,18 @@
+{
+ "DEFAULTS": {
+ "threshold": 0.5,
+ "minSpeechDurationMs": 250,
+ "minSilenceDurationMs": 200,
+ "maxSpeechDurationS": 30,
+ "speechPadMs": 100,
+ "samplesOverlap": 0.5
+ },
+ "LIMITS": {
+ "threshold": { "min": 0.1, "max": 0.95, "round": false },
+ "minSpeechDurationMs": { "min": 50, "max": 2000, "round": true },
+ "minSilenceDurationMs": { "min": 50, "max": 2000, "round": true },
+ "maxSpeechDurationS": { "min": 5, "max": 120, "round": true },
+ "speechPadMs": { "min": 0, "max": 1000, "round": true },
+ "samplesOverlap": { "min": 0, "max": 0.95, "round": false }
+ }
+}
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 00c27e709..25e12d84c 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -34,6 +34,11 @@ const {
DEFAULT_EXPECTED_SPEAKER_COUNT,
MAX_SPEAKER_COUNT,
} = require("../constants/speakerDetection.json");
+const {
+ DEFAULT_WHISPER_VAD_CONFIG,
+ sanitizeWhisperVadConfig,
+ resolveContextSileroEnabled,
+} = require("./whisperVadConfig");
const STREAMING_CLIENT_BY_PROVIDER = {
"openai-realtime": OpenAIRealtimeStreaming,
@@ -319,6 +324,12 @@ class IPCHandlers {
this._noteFilesEnabled = false;
this.speakerDiarizationEnabled = true;
this.activeMeetingSpeakerConfig = null;
+ this.whisperVadSettings = {
+ dictationSileroEnabled: true,
+ noteRecordingSileroEnabled: true,
+ meetingSileroEnabled: true,
+ ...DEFAULT_WHISPER_VAD_CONFIG,
+ };
liveSpeakerIdentifier.setDiarizationManager(this.diarizationManager);
this._setupTextEditMonitor();
this._setupAudioCleanup();
@@ -332,6 +343,35 @@ class IPCHandlers {
}
}
+ _getWhisperVadSettings() {
+ const current = this.whisperVadSettings || {};
+ return {
+ dictationSileroEnabled: current.dictationSileroEnabled !== false,
+ noteRecordingSileroEnabled: current.noteRecordingSileroEnabled !== false,
+ meetingSileroEnabled: current.meetingSileroEnabled !== false,
+ ...sanitizeWhisperVadConfig(current),
+ };
+ }
+
+ _setWhisperVadSettings(update = {}) {
+ this.whisperVadSettings = { ...this._getWhisperVadSettings(), ...update };
+ return this._getWhisperVadSettings();
+ }
+
+ _resolveWhisperVadOptions(context) {
+ const settings = this._getWhisperVadSettings();
+ const {
+ dictationSileroEnabled,
+ noteRecordingSileroEnabled,
+ meetingSileroEnabled,
+ ...vadConfig
+ } = settings;
+ return {
+ vadEnabled: resolveContextSileroEnabled(settings, context),
+ vadConfig,
+ };
+ }
+
_asyncVectorUpsert(note) {
setImmediate(() => {
const vectorIndex = require("./vectorIndex");
@@ -1405,7 +1445,11 @@ class IPCHandlers {
const result = await this.parakeetManager.transcribeLocalParakeet(audioBuffer, options);
return result;
}
- const result = await this.whisperManager.transcribeLocalWhisper(audioBuffer, options);
+ const vadOptions = this._resolveWhisperVadOptions("noteRecording");
+ const result = await this.whisperManager.transcribeLocalWhisper(audioBuffer, {
+ ...options,
+ ...vadOptions,
+ });
return result;
} catch (error) {
debugLogger.error("Audio file transcription error", { error: error.message });
@@ -1484,7 +1528,11 @@ class IPCHandlers {
});
try {
- const result = await this.whisperManager.transcribeLocalWhisper(audioBlob, options);
+ const vadOptions = this._resolveWhisperVadOptions("dictation");
+ const result = await this.whisperManager.transcribeLocalWhisper(audioBlob, {
+ ...options,
+ ...vadOptions,
+ });
debugLogger.log("Whisper result", {
success: result.success,
@@ -3541,9 +3589,11 @@ class IPCHandlers {
settings.parakeetModel || process.env.PARAKEET_MODEL || "parakeet-tdt-0.6b-v3";
result = await this.parakeetManager.transcribeLocalParakeet(buffer, { model });
} else if (this.whisperManager?.serverManager?.isAvailable?.()) {
+ const vadOptions = this._resolveWhisperVadOptions("noteRecording");
result = await this.whisperManager.transcribeLocalWhisper(buffer, {
model: settings.whisperModel,
language,
+ ...vadOptions,
});
}
} else if (settings?.cloudTranscriptionMode === "openwhispr") {
@@ -4692,9 +4742,11 @@ class IPCHandlers {
model: meetingLocalModel,
});
} else {
+ const vadOptions = this._resolveWhisperVadOptions("meeting");
result = await this.whisperManager.transcribeLocalWhisper(wav, {
model: meetingLocalModel,
language: meetingLocalLanguage,
+ ...vadOptions,
});
}
@@ -4931,9 +4983,11 @@ class IPCHandlers {
model: dictationPreviewModel,
});
} else {
+ const vadOptions = this._resolveWhisperVadOptions("dictation");
result = await this.whisperManager.transcribeLocalWhisper(wav, {
model: dictationPreviewModel,
language: dictationPreviewLanguage,
+ ...vadOptions,
});
}
@@ -7144,6 +7198,23 @@ class IPCHandlers {
}
});
+ ipcMain.handle("whisper-vad-get-config", async () => {
+ try {
+ return { success: true, config: this._getWhisperVadSettings() };
+ } catch (error) {
+ return { success: false, error: error.message };
+ }
+ });
+
+ ipcMain.handle("whisper-vad-set-config", async (_event, payload) => {
+ try {
+ const config = this._setWhisperVadSettings(payload || {});
+ return { success: true, config };
+ } catch (error) {
+ return { success: false, error: error.message };
+ }
+ });
+
ipcMain.handle("meeting-set-session-speaker-config", async (_event, payload) => {
try {
const enabled = payload?.enabled !== false;
@@ -7626,10 +7697,8 @@ class IPCHandlers {
_resolveSpeakerExpectation({ sessionConfig, noteId, observedSpeakerIds }) {
if (sessionConfig?.expectedCount) {
const total = Math.min(sessionConfig.expectedCount, MAX_SPEAKER_COUNT);
- return {
- numSpeakers: Math.max(1, total - 1),
- cap: null,
- };
+ const numSpeakers = Math.max(1, total - 1);
+ return { numSpeakers, cap: numSpeakers };
}
let attendees = [];
@@ -7642,17 +7711,13 @@ class IPCHandlers {
}
}
if (attendees.length >= 2) {
- return {
- numSpeakers: Math.min(attendees.length, MAX_SPEAKER_COUNT),
- cap: null,
- };
+ const numSpeakers = Math.min(attendees.length, MAX_SPEAKER_COUNT);
+ return { numSpeakers, cap: numSpeakers };
}
if (observedSpeakerIds.size >= 2) {
- return {
- numSpeakers: Math.min(observedSpeakerIds.size, MAX_SPEAKER_COUNT),
- cap: null,
- };
+ const numSpeakers = Math.min(observedSpeakerIds.size, MAX_SPEAKER_COUNT);
+ return { numSpeakers, cap: numSpeakers };
}
return { numSpeakers: -1, cap: DEFAULT_EXPECTED_SPEAKER_COUNT };
diff --git a/src/helpers/whisper.js b/src/helpers/whisper.js
index d96e45671..5f5cc24b8 100644
--- a/src/helpers/whisper.js
+++ b/src/helpers/whisper.js
@@ -39,6 +39,7 @@ class WhisperManager {
// Server manager for HTTP-based transcription
this.serverManager = new WhisperServerManager();
this.currentServerModel = null;
+ this.cachedVadModelPath = undefined;
}
getModelsDir() {
@@ -60,6 +61,22 @@ class WhisperManager {
return path.join(this.getModelsDir(), config.fileName);
}
+ getVadModelPath() {
+ if (this.cachedVadModelPath !== undefined) return this.cachedVadModelPath;
+
+ const fileName = "ggml-silero-v5.1.2.bin";
+ const candidates = [];
+
+ if (process.resourcesPath) {
+ candidates.push(path.join(process.resourcesPath, "bin", "whisper-vad", fileName));
+ }
+ candidates.push(path.join(__dirname, "..", "..", "resources", "bin", "whisper-vad", fileName));
+
+ const resolved = candidates.find((p) => fs.existsSync(p)) || null;
+ this.cachedVadModelPath = resolved;
+ return resolved;
+ }
+
async initializeAtStartup(settings = {}) {
const startTime = Date.now();
@@ -254,27 +271,38 @@ class WhisperManager {
const model = options.model || "base";
const language = options.language || null;
const initialPrompt = options.initialPrompt || null;
+ const vadEnabled = options.vadEnabled === true;
+ const vadConfig = options.vadConfig || null;
const modelPath = this.getModelPath(model);
- // Check if model exists
if (!fs.existsSync(modelPath)) {
throw new Error(`Whisper model "${model}" not downloaded. Please download it from Settings.`);
}
- return await this.transcribeViaServer(audioBlob, model, language, initialPrompt);
+ return await this.transcribeViaServer(audioBlob, model, language, initialPrompt, {
+ vadEnabled,
+ vadConfig,
+ });
}
- async transcribeViaServer(audioBlob, model, language, initialPrompt = null) {
+ async transcribeViaServer(audioBlob, model, language, initialPrompt = null, options = {}) {
debugLogger.info("Transcription mode: SERVER", { model, language: language || "auto" });
const modelPath = this.getModelPath(model);
- // Start server if not running or if model changed
- if (!this.serverManager.ready || this.currentServerModel !== model) {
- debugLogger.debug("Starting/restarting whisper-server for model", { model });
- await this.serverManager.start(modelPath, { useCuda: this.serverManager.useCuda });
- this.currentServerModel = model;
+ const vadEnabled = options.vadEnabled === true;
+ const vadModelPath = vadEnabled ? this.getVadModelPath() : null;
+ if (vadEnabled && !vadModelPath) {
+ debugLogger.warn("VAD requested but ggml-silero model not found; running without VAD");
}
+ await this.serverManager.start(modelPath, {
+ useCuda: this.serverManager.useCuda,
+ vadEnabled,
+ vadModelPath,
+ vadConfig: options.vadConfig || null,
+ });
+ this.currentServerModel = model;
+
// Convert audioBlob to Buffer if needed
let audioBuffer;
if (Buffer.isBuffer(audioBlob)) {
diff --git a/src/helpers/whisperServer.js b/src/helpers/whisperServer.js
index 6edcbc639..4afe05a56 100644
--- a/src/helpers/whisperServer.js
+++ b/src/helpers/whisperServer.js
@@ -10,6 +10,7 @@ const { killProcess } = require("../utils/process");
const { getSafeTempDir } = require("./safeTempDir");
const { convertToWav } = require("./ffmpegUtils");
const sidecarPidFile = require("./sidecarPidFile");
+const { sanitizeWhisperVadConfig, DEFAULT_WHISPER_VAD_CONFIG } = require("./whisperVadConfig");
const PORT_RANGE_START = 8178;
const PORT_RANGE_END = 8199;
@@ -17,6 +18,57 @@ const STARTUP_TIMEOUT_MS = 30000;
const HEALTH_CHECK_INTERVAL_MS = 5000;
const HEALTH_CHECK_TIMEOUT_MS = 2000;
+function isVadActive(options = {}) {
+ return options.vadEnabled === true && !!options.vadModelPath;
+}
+
+function getVadSignature(options = {}) {
+ if (!isVadActive(options)) return "vad:off";
+ const vadConfig = sanitizeWhisperVadConfig(options.vadConfig || DEFAULT_WHISPER_VAD_CONFIG);
+ return `vad:on:${options.vadModelPath}:${JSON.stringify(vadConfig)}`;
+}
+
+function buildWhisperServerArgs({
+ modelPath,
+ port,
+ language,
+ threads,
+ vadEnabled = false,
+ vadModelPath = null,
+ vadConfig,
+}) {
+ const args = ["--model", modelPath, "--host", "127.0.0.1", "--port", String(port)];
+
+ if (threads) args.push("--threads", String(threads));
+
+ // whisper.cpp defaults to English when --language is omitted;
+ // explicitly pass "auto" to enable language auto-detection
+ args.push("--language", language || "auto");
+
+ if (isVadActive({ vadEnabled, vadModelPath })) {
+ const cfg = sanitizeWhisperVadConfig(vadConfig || DEFAULT_WHISPER_VAD_CONFIG);
+ args.push(
+ "--vad",
+ "--vad-model",
+ vadModelPath,
+ "--vad-threshold",
+ String(cfg.threshold),
+ "--vad-min-speech-duration-ms",
+ String(cfg.minSpeechDurationMs),
+ "--vad-min-silence-duration-ms",
+ String(cfg.minSilenceDurationMs),
+ "--vad-max-speech-duration-s",
+ String(cfg.maxSpeechDurationS),
+ "--vad-speech-pad-ms",
+ String(cfg.speechPadMs),
+ "--vad-samples-overlap",
+ String(cfg.samplesOverlap)
+ );
+ }
+
+ return args;
+}
+
class WhisperServerManager extends EventEmitter {
constructor() {
super();
@@ -32,6 +84,7 @@ class WhisperServerManager extends EventEmitter {
this.cachedFFmpegPath = null;
this.canConvert = false;
this.useCuda = false;
+ this.vadSignature = "vad:off";
}
getFFmpegPath() {
@@ -240,7 +293,15 @@ class WhisperServerManager extends EventEmitter {
async start(modelPath, options = {}) {
if (this.startupPromise) return this.startupPromise;
- if (this.ready && this.modelPath === modelPath && !this.isRemote) return;
+ const nextVadSignature = getVadSignature(options);
+ if (
+ this.ready &&
+ this.modelPath === modelPath &&
+ !this.isRemote &&
+ this.vadSignature === nextVadSignature
+ ) {
+ return;
+ }
if (this.process || this.isRemote) {
await this.stop();
@@ -248,6 +309,7 @@ class WhisperServerManager extends EventEmitter {
this.isRemote = false;
this.hostname = "127.0.0.1";
+ this.vadSignature = nextVadSignature;
this.startupPromise = this._doStart(modelPath, options);
try {
await this.startupPromise;
@@ -285,7 +347,15 @@ class WhisperServerManager extends EventEmitter {
spawnEnv.CUDA_VISIBLE_DEVICES = process.env.TRANSCRIPTION_GPU_INDEX;
}
- const args = ["--model", modelPath, "--host", "127.0.0.1", "--port", String(this.port)];
+ const args = buildWhisperServerArgs({
+ modelPath,
+ port: this.port,
+ language: options.language,
+ threads: options.threads,
+ vadEnabled: options.vadEnabled === true,
+ vadModelPath: options.vadModelPath || null,
+ vadConfig: options.vadConfig,
+ });
// FFmpeg is required for pre-converting audio to 16kHz mono WAV
this.canConvert = !!ffmpegPath;
@@ -296,11 +366,6 @@ class WhisperServerManager extends EventEmitter {
debugLogger.warn("FFmpeg not found - whisper-server will only accept 16kHz mono WAV");
}
- if (options.threads) args.push("--threads", String(options.threads));
- // whisper.cpp defaults to English when --language is omitted;
- // explicitly pass "auto" to enable language auto-detection
- args.push("--language", options.language || "auto");
-
debugLogger.debug("Starting whisper-server", {
port: this.port,
modelPath,
@@ -656,3 +721,5 @@ class WhisperServerManager extends EventEmitter {
}
module.exports = WhisperServerManager;
+module.exports.buildWhisperServerArgs = buildWhisperServerArgs;
+module.exports.getVadSignature = getVadSignature;
diff --git a/src/helpers/whisperVadConfig.js b/src/helpers/whisperVadConfig.js
new file mode 100644
index 000000000..c3eaee5b6
--- /dev/null
+++ b/src/helpers/whisperVadConfig.js
@@ -0,0 +1,37 @@
+const { DEFAULTS, LIMITS } = require("../constants/whisperVad.json");
+
+const DEFAULT_WHISPER_VAD_CONFIG = Object.freeze({ ...DEFAULTS });
+const VAD_LIMITS = Object.freeze(LIMITS);
+
+function clampVadField(key, value) {
+ const fallback = DEFAULTS[key];
+ const n = value === null || value === undefined || value === "" ? fallback : Number(value);
+ if (!Number.isFinite(n)) return fallback;
+ const { min, max, round } = LIMITS[key];
+ const clamped = Math.min(max, Math.max(min, n));
+ return round ? Math.round(clamped) : clamped;
+}
+
+function sanitizeWhisperVadConfig(input = {}) {
+ const merged = { ...DEFAULTS, ...(input || {}) };
+ const out = {};
+ for (const key of Object.keys(DEFAULTS)) {
+ out[key] = clampVadField(key, merged[key]);
+ }
+ return out;
+}
+
+function resolveContextSileroEnabled(settings = {}, context = "dictation") {
+ if (context === "dictation") return settings.dictationSileroEnabled !== false;
+ if (context === "noteRecording") return settings.noteRecordingSileroEnabled !== false;
+ if (context === "meeting") return settings.meetingSileroEnabled !== false;
+ return true;
+}
+
+module.exports = {
+ DEFAULT_WHISPER_VAD_CONFIG,
+ VAD_LIMITS,
+ clampVadField,
+ sanitizeWhisperVadConfig,
+ resolveContextSileroEnabled,
+};
diff --git a/src/hooks/useActionProcessing.ts b/src/hooks/useActionProcessing.ts
index 9462a31b2..357461097 100644
--- a/src/hooks/useActionProcessing.ts
+++ b/src/hooks/useActionProcessing.ts
@@ -22,12 +22,7 @@ export function useActionProcessing(noteId: number | null) {
);
const runAction = useCallback(
- (
- action: ActionItem,
- noteContent: string,
- contentHash: string,
- options: RunActionOptions
- ) => {
+ (action: ActionItem, noteContent: string, contentHash: string, options: RunActionOptions) => {
if (noteId == null) return;
runBackgroundAction(noteId, noteContent, contentHash, action, options, {
noModel: t("notes.actions.errors.noModel"),
diff --git a/src/hooks/useSettings.ts b/src/hooks/useSettings.ts
index 697287448..2fb2aee66 100644
--- a/src/hooks/useSettings.ts
+++ b/src/hooks/useSettings.ts
@@ -285,6 +285,24 @@ function useSettingsInternal() {
setNoteFilesEnabled: store.setNoteFilesEnabled,
noteFilesPath: store.noteFilesPath,
setNoteFilesPath: store.setNoteFilesPath,
+ dictationSileroEnabled: store.dictationSileroEnabled,
+ setDictationSileroEnabled: store.setDictationSileroEnabled,
+ noteRecordingSileroEnabled: store.noteRecordingSileroEnabled,
+ setNoteRecordingSileroEnabled: store.setNoteRecordingSileroEnabled,
+ meetingSileroEnabled: store.meetingSileroEnabled,
+ setMeetingSileroEnabled: store.setMeetingSileroEnabled,
+ whisperVadThreshold: store.whisperVadThreshold,
+ setWhisperVadThreshold: store.setWhisperVadThreshold,
+ whisperVadMinSpeechDurationMs: store.whisperVadMinSpeechDurationMs,
+ setWhisperVadMinSpeechDurationMs: store.setWhisperVadMinSpeechDurationMs,
+ whisperVadMinSilenceDurationMs: store.whisperVadMinSilenceDurationMs,
+ setWhisperVadMinSilenceDurationMs: store.setWhisperVadMinSilenceDurationMs,
+ whisperVadMaxSpeechDurationS: store.whisperVadMaxSpeechDurationS,
+ setWhisperVadMaxSpeechDurationS: store.setWhisperVadMaxSpeechDurationS,
+ whisperVadSpeechPadMs: store.whisperVadSpeechPadMs,
+ setWhisperVadSpeechPadMs: store.setWhisperVadSpeechPadMs,
+ whisperVadSamplesOverlap: store.whisperVadSamplesOverlap,
+ setWhisperVadSamplesOverlap: store.setWhisperVadSamplesOverlap,
cloudBackupEnabled: store.cloudBackupEnabled,
setCloudBackupEnabled: store.setCloudBackupEnabled,
telemetryEnabled: store.telemetryEnabled,
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index 5b744766c..d0a2482be 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -1547,7 +1547,51 @@
"deleteModels": "Modelle löschen"
},
"transcriptionPreview": "Live-Transkriptionsvorschau",
- "transcriptionPreviewDescription": "Transkription vor der Bereinigung in einem Fenster anzeigen"
+ "transcriptionPreviewDescription": "Transkription vor der Bereinigung in einem Fenster anzeigen",
+ "vad": {
+ "title": "Sprachaktivitätserkennung",
+ "description": "Konfiguriere, wie Silero VAD Sprache für die lokale Whisper-Transkription erkennt und segmentiert",
+ "toggles": {
+ "dictation": {
+ "title": "Silero VAD für Diktat",
+ "description": "Sprachaktivitätserkennung für lokales Diktat aktivieren"
+ },
+ "noteRecording": {
+ "title": "Silero VAD für Notizaufnahme",
+ "description": "Sprachaktivitätserkennung für lokale Notizaufnahme aktivieren"
+ },
+ "meeting": {
+ "title": "Silero VAD für Meetings",
+ "description": "Sprachaktivitätserkennung für lokale Meeting-Transkription aktivieren"
+ }
+ },
+ "fields": {
+ "threshold": {
+ "label": "VAD-Schwellenwert",
+ "info": "Wahrscheinlichkeit, ab der ein Frame als Sprache eingestuft wird."
+ },
+ "minSpeechDurationMs": {
+ "label": "Minimale Sprachdauer (ms)",
+ "info": "Kürzere Sprachsegmente werden als Rauschen oder Falscherkennung verworfen."
+ },
+ "minSilenceDurationMs": {
+ "label": "Minimale Pausendauer (ms)",
+ "info": "Eine Pause muss mindestens so lang sein, um ein Sprachsegment zu beenden. Kürzere Pausen bleiben Teil des Segments."
+ },
+ "maxSpeechDurationS": {
+ "label": "Maximale Sprachdauer (s)",
+ "info": "Längere Segmente werden an Pausen aufgeteilt, damit einzelne Stücke handhabbar bleiben."
+ },
+ "speechPadMs": {
+ "label": "Sprach-Polsterung (ms)",
+ "info": "Zusätzliche Polsterung vor und nach jedem Segment, damit Wortgrenzen nicht abgeschnitten werden."
+ },
+ "samplesOverlap": {
+ "label": "Sample-Überlappung (s)",
+ "info": "Audio, das von einem Segment ins nächste übertragen wird, um abrupte Schnitte beim Zusammenfügen zu vermeiden."
+ }
+ }
+ }
},
"intelligence": {
"gpuDevice": {
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index 53d5120c9..ddbab00f9 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -1643,7 +1643,51 @@
"deleteModels": "Delete Models"
},
"transcriptionPreview": "Live Transcription Preview",
- "transcriptionPreviewDescription": "Show transcription in a floating window before cleanup"
+ "transcriptionPreviewDescription": "Show transcription in a floating window before cleanup",
+ "vad": {
+ "title": "Voice Activity Detection",
+ "description": "Configure how Silero VAD detects and segments speech for local Whisper transcription",
+ "toggles": {
+ "dictation": {
+ "title": "Silero VAD for Dictation",
+ "description": "Enable voice activity detection for local dictation transcription"
+ },
+ "noteRecording": {
+ "title": "Silero VAD for Note Recording",
+ "description": "Enable voice activity detection for local note recording transcription"
+ },
+ "meeting": {
+ "title": "Silero VAD for Meetings",
+ "description": "Enable voice activity detection for local meeting transcription"
+ }
+ },
+ "fields": {
+ "threshold": {
+ "label": "VAD threshold",
+ "info": "Probability above which a frame is classified as speech."
+ },
+ "minSpeechDurationMs": {
+ "label": "Minimum speech duration (ms)",
+ "info": "Speech segments shorter than this are discarded as noise or false positives."
+ },
+ "minSilenceDurationMs": {
+ "label": "Minimum silence duration (ms)",
+ "info": "Silence must last at least this long to end a speech segment. Shorter pauses are kept inside the segment."
+ },
+ "maxSpeechDurationS": {
+ "label": "Maximum speech duration (s)",
+ "info": "Segments longer than this are split at silence points to keep individual chunks manageable."
+ },
+ "speechPadMs": {
+ "label": "Speech padding (ms)",
+ "info": "Padding added before and after each detected segment so word edges are not clipped."
+ },
+ "samplesOverlap": {
+ "label": "Samples overlap (s)",
+ "info": "Audio carried from each segment into the next to avoid abrupt cuts when concatenating."
+ }
+ }
+ }
},
"intelligence": {
"gpuDevice": {
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index c32b5acfe..de16ac702 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -544,7 +544,7 @@
"optionalPasteTool": "Para pegado automático, instala {{tool}}:\n\n{{installCmd}}{{waylandNote}}\n\nSin esto, aún puedes usar OpenWhispr: el texto se copiará al portapapeles y podrás pegar con Ctrl+V."
},
"alerts": {
- "accessibilityNeeded": "Se requieren permisos de accesibilidad. Concédelos en la configuración del sistema."
+ "accessibilityNeeded": "¡Se necesitan permisos de accesibilidad! Concédelos en la configuración del sistema."
},
"notes": {
"waylandWtype": "\n\nNota: para apps XWayland, xdotool también funciona.",
@@ -1595,7 +1595,51 @@
"deleteModels": "Eliminar modelos"
},
"transcriptionPreview": "Vista previa en vivo",
- "transcriptionPreviewDescription": "Mostrar transcripción en una ventana flotante antes de la corrección"
+ "transcriptionPreviewDescription": "Mostrar transcripción en una ventana flotante antes de la corrección",
+ "vad": {
+ "title": "Detección de actividad de voz",
+ "description": "Configura cómo Silero VAD detecta y segmenta el habla para la transcripción local con Whisper",
+ "toggles": {
+ "dictation": {
+ "title": "Silero VAD para dictado",
+ "description": "Activa la detección de actividad de voz para dictado local"
+ },
+ "noteRecording": {
+ "title": "Silero VAD para grabación de notas",
+ "description": "Activa la detección de actividad de voz para grabación local de notas"
+ },
+ "meeting": {
+ "title": "Silero VAD para reuniones",
+ "description": "Activa la detección de actividad de voz para transcripción local de reuniones"
+ }
+ },
+ "fields": {
+ "threshold": {
+ "label": "Umbral de VAD",
+ "info": "Probabilidad a partir de la cual un fragmento se clasifica como voz."
+ },
+ "minSpeechDurationMs": {
+ "label": "Duración mínima de voz (ms)",
+ "info": "Segmentos de voz más cortos se descartan como ruido o falsos positivos."
+ },
+ "minSilenceDurationMs": {
+ "label": "Duración mínima de silencio (ms)",
+ "info": "El silencio debe durar al menos esto para cerrar un segmento. Pausas más cortas se incluyen dentro del segmento."
+ },
+ "maxSpeechDurationS": {
+ "label": "Duración máxima de voz (s)",
+ "info": "Segmentos más largos se dividen en puntos de silencio para mantener piezas manejables."
+ },
+ "speechPadMs": {
+ "label": "Relleno de voz (ms)",
+ "info": "Relleno añadido antes y después de cada segmento para no recortar los bordes de las palabras."
+ },
+ "samplesOverlap": {
+ "label": "Solapamiento de muestras (s)",
+ "info": "Audio que se extiende de un segmento al siguiente para evitar cortes bruscos al concatenarlos."
+ }
+ }
+ }
},
"intelligence": {
"gpuDevice": {
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index 3f0371845..edc3684bd 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -1595,7 +1595,51 @@
"deleteModels": "Supprimer les modèles"
},
"transcriptionPreview": "Aperçu en direct",
- "transcriptionPreviewDescription": "Afficher la transcription dans une fenêtre flottante avant correction"
+ "transcriptionPreviewDescription": "Afficher la transcription dans une fenêtre flottante avant correction",
+ "vad": {
+ "title": "Détection d'activité vocale",
+ "description": "Configurez la manière dont Silero VAD détecte et segmente la parole pour la transcription locale Whisper",
+ "toggles": {
+ "dictation": {
+ "title": "Silero VAD pour la dictée",
+ "description": "Activer la détection d'activité vocale pour la dictée locale"
+ },
+ "noteRecording": {
+ "title": "Silero VAD pour l'enregistrement de notes",
+ "description": "Activer la détection d'activité vocale pour l'enregistrement local des notes"
+ },
+ "meeting": {
+ "title": "Silero VAD pour les réunions",
+ "description": "Activer la détection d'activité vocale pour la transcription locale des réunions"
+ }
+ },
+ "fields": {
+ "threshold": {
+ "label": "Seuil VAD",
+ "info": "Probabilité au-delà de laquelle une trame est classée comme parole."
+ },
+ "minSpeechDurationMs": {
+ "label": "Durée minimale de parole (ms)",
+ "info": "Les segments plus courts sont rejetés comme bruit ou faux positifs."
+ },
+ "minSilenceDurationMs": {
+ "label": "Durée minimale de silence (ms)",
+ "info": "Un silence doit durer au moins ce temps pour terminer un segment. Les pauses plus courtes restent dans le segment."
+ },
+ "maxSpeechDurationS": {
+ "label": "Durée maximale de parole (s)",
+ "info": "Les segments plus longs sont divisés aux points de silence pour rester manipulables."
+ },
+ "speechPadMs": {
+ "label": "Marge de parole (ms)",
+ "info": "Marge ajoutée avant et après chaque segment pour ne pas couper les bords des mots."
+ },
+ "samplesOverlap": {
+ "label": "Chevauchement (s)",
+ "info": "Audio prolongé d'un segment au suivant pour éviter les coupures brusques lors de la concaténation."
+ }
+ }
+ }
},
"intelligence": {
"gpuDevice": {
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index 50ec9284e..2d6b7e0c7 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -1547,7 +1547,51 @@
"deleteModels": "Elimina modelli"
},
"transcriptionPreview": "Anteprima dal vivo",
- "transcriptionPreviewDescription": "Mostra la trascrizione in una finestra flottante prima della correzione"
+ "transcriptionPreviewDescription": "Mostra la trascrizione in una finestra flottante prima della correzione",
+ "vad": {
+ "title": "Rilevamento attività vocale",
+ "description": "Configura come Silero VAD rileva e segmenta il parlato per la trascrizione locale Whisper",
+ "toggles": {
+ "dictation": {
+ "title": "Silero VAD per dettatura",
+ "description": "Abilita il rilevamento di attività vocale per la dettatura locale"
+ },
+ "noteRecording": {
+ "title": "Silero VAD per registrazione note",
+ "description": "Abilita il rilevamento di attività vocale per la registrazione locale delle note"
+ },
+ "meeting": {
+ "title": "Silero VAD per riunioni",
+ "description": "Abilita il rilevamento di attività vocale per la trascrizione locale delle riunioni"
+ }
+ },
+ "fields": {
+ "threshold": {
+ "label": "Soglia VAD",
+ "info": "Probabilità oltre la quale un frame viene classificato come parlato."
+ },
+ "minSpeechDurationMs": {
+ "label": "Durata minima del parlato (ms)",
+ "info": "I segmenti di parlato più brevi vengono scartati come rumore o falsi positivi."
+ },
+ "minSilenceDurationMs": {
+ "label": "Durata minima di silenzio (ms)",
+ "info": "Il silenzio deve durare almeno questo tempo per terminare un segmento. Pause più brevi restano nel segmento."
+ },
+ "maxSpeechDurationS": {
+ "label": "Durata massima del parlato (s)",
+ "info": "I segmenti più lunghi vengono divisi nei punti di silenzio per mantenere blocchi gestibili."
+ },
+ "speechPadMs": {
+ "label": "Riempimento del parlato (ms)",
+ "info": "Riempimento aggiunto prima e dopo ogni segmento per non tagliare i bordi delle parole."
+ },
+ "samplesOverlap": {
+ "label": "Sovrapposizione campioni (s)",
+ "info": "Audio esteso da un segmento al successivo per evitare tagli netti nella concatenazione."
+ }
+ }
+ }
},
"intelligence": {
"gpuDevice": {
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index d73bcfdab..c6e0acabe 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -1547,7 +1547,51 @@
"deleteModels": "モデルを削除"
},
"transcriptionPreview": "リアルタイム文字起こしプレビュー",
- "transcriptionPreviewDescription": "クリーンアップ前にフローティングウィンドウで文字起こしを表示"
+ "transcriptionPreviewDescription": "クリーンアップ前にフローティングウィンドウで文字起こしを表示",
+ "vad": {
+ "title": "音声アクティビティ検出",
+ "description": "ローカル Whisper 文字起こしで Silero VAD が発話を検出・分割する方法を設定します",
+ "toggles": {
+ "dictation": {
+ "title": "ディクテーションで Silero VAD を使用",
+ "description": "ローカルディクテーションで音声アクティビティ検出を有効化"
+ },
+ "noteRecording": {
+ "title": "ノート録音で Silero VAD を使用",
+ "description": "ローカルノート録音で音声アクティビティ検出を有効化"
+ },
+ "meeting": {
+ "title": "会議で Silero VAD を使用",
+ "description": "ローカル会議文字起こしで音声アクティビティ検出を有効化"
+ }
+ },
+ "fields": {
+ "threshold": {
+ "label": "VAD しきい値",
+ "info": "フレームを音声として分類する確率のしきい値です。"
+ },
+ "minSpeechDurationMs": {
+ "label": "最小発話時間 (ms)",
+ "info": "これより短い発話区間はノイズや誤検出として破棄されます。"
+ },
+ "minSilenceDurationMs": {
+ "label": "最小無音時間 (ms)",
+ "info": "発話区間を終了するには最低この長さの無音が必要です。短い無音は区間に含まれます。"
+ },
+ "maxSpeechDurationS": {
+ "label": "最大発話時間 (秒)",
+ "info": "これより長い区間は無音の位置で分割され、扱いやすい長さに保たれます。"
+ },
+ "speechPadMs": {
+ "label": "発話パディング (ms)",
+ "info": "単語の端が切れないよう、各区間の前後に追加されるパディングです。"
+ },
+ "samplesOverlap": {
+ "label": "サンプル重なり (秒)",
+ "info": "区間を連結するときに途切れないよう、次の区間に延長する音声の長さです。"
+ }
+ }
+ }
},
"intelligence": {
"gpuDevice": {
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index feebb659b..306fdb1fe 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -1519,7 +1519,51 @@
"deleteModels": "Excluir modelos"
},
"transcriptionPreview": "Pré-visualização ao vivo",
- "transcriptionPreviewDescription": "Mostrar transcrição em janela flutuante antes da limpeza"
+ "transcriptionPreviewDescription": "Mostrar transcrição em janela flutuante antes da limpeza",
+ "vad": {
+ "title": "Detecção de atividade de voz",
+ "description": "Configure como o Silero VAD detecta e segmenta a fala na transcrição local do Whisper",
+ "toggles": {
+ "dictation": {
+ "title": "Silero VAD para ditado",
+ "description": "Ativar detecção de atividade de voz para ditado local"
+ },
+ "noteRecording": {
+ "title": "Silero VAD para gravação de notas",
+ "description": "Ativar detecção de atividade de voz para gravação local de notas"
+ },
+ "meeting": {
+ "title": "Silero VAD para reuniões",
+ "description": "Ativar detecção de atividade de voz para transcrição local de reuniões"
+ }
+ },
+ "fields": {
+ "threshold": {
+ "label": "Limiar de VAD",
+ "info": "Probabilidade acima da qual um quadro é classificado como fala."
+ },
+ "minSpeechDurationMs": {
+ "label": "Duração mínima da fala (ms)",
+ "info": "Segmentos de fala mais curtos são descartados como ruído ou falsos positivos."
+ },
+ "minSilenceDurationMs": {
+ "label": "Duração mínima de silêncio (ms)",
+ "info": "O silêncio precisa durar pelo menos esse tempo para encerrar um segmento. Pausas mais curtas permanecem dentro do segmento."
+ },
+ "maxSpeechDurationS": {
+ "label": "Duração máxima da fala (s)",
+ "info": "Segmentos maiores são divididos em pontos de silêncio para manter pedaços gerenciáveis."
+ },
+ "speechPadMs": {
+ "label": "Preenchimento da fala (ms)",
+ "info": "Preenchimento antes e depois de cada segmento para não cortar as bordas das palavras."
+ },
+ "samplesOverlap": {
+ "label": "Sobreposição de amostras (s)",
+ "info": "Áudio estendido de um segmento para o próximo, evitando cortes bruscos na concatenação."
+ }
+ }
+ }
},
"intelligence": {
"gpuDevice": {
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index dba3e1995..d2031431f 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -1547,7 +1547,51 @@
"deleteModels": "Удалить модели"
},
"transcriptionPreview": "Предпросмотр транскрипции",
- "transcriptionPreviewDescription": "Показывать транскрипцию в плавающем окне перед очисткой"
+ "transcriptionPreviewDescription": "Показывать транскрипцию в плавающем окне перед очисткой",
+ "vad": {
+ "title": "Определение голосовой активности",
+ "description": "Настройте, как Silero VAD обнаруживает и сегментирует речь для локальной транскрипции Whisper",
+ "toggles": {
+ "dictation": {
+ "title": "Silero VAD для диктовки",
+ "description": "Включить определение голосовой активности для локальной диктовки"
+ },
+ "noteRecording": {
+ "title": "Silero VAD для записи заметок",
+ "description": "Включить определение голосовой активности для локальной записи заметок"
+ },
+ "meeting": {
+ "title": "Silero VAD для встреч",
+ "description": "Включить определение голосовой активности для локальной транскрипции встреч"
+ }
+ },
+ "fields": {
+ "threshold": {
+ "label": "Порог VAD",
+ "info": "Порог вероятности, выше которого кадр считается речью."
+ },
+ "minSpeechDurationMs": {
+ "label": "Мин. длительность речи (мс)",
+ "info": "Более короткие сегменты речи отбрасываются как шум или ложные срабатывания."
+ },
+ "minSilenceDurationMs": {
+ "label": "Мин. длительность тишины (мс)",
+ "info": "Тишина должна длиться не меньше этого, чтобы завершить сегмент. Более короткие паузы остаются внутри сегмента."
+ },
+ "maxSpeechDurationS": {
+ "label": "Макс. длительность речи (с)",
+ "info": "Более длинные сегменты делятся в точках тишины, чтобы оставаться управляемыми."
+ },
+ "speechPadMs": {
+ "label": "Запас по речи (мс)",
+ "info": "Запас, добавляемый до и после каждого сегмента, чтобы не обрезать края слов."
+ },
+ "samplesOverlap": {
+ "label": "Перекрытие сэмплов (с)",
+ "info": "Звук, продлеваемый из одного сегмента в следующий, чтобы избежать резких обрывов при склейке."
+ }
+ }
+ }
},
"intelligence": {
"gpuDevice": {
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index cbc04ca96..b17b8d986 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -1542,7 +1542,51 @@
"deleteModels": "删除模型"
},
"transcriptionPreview": "实时转录预览",
- "transcriptionPreviewDescription": "在浮动窗口中显示转录结果,然后再进行文本整理"
+ "transcriptionPreviewDescription": "在浮动窗口中显示转录结果,然后再进行文本整理",
+ "vad": {
+ "title": "语音活动检测",
+ "description": "配置 Silero VAD 如何为本地 Whisper 转录检测并切分语音",
+ "toggles": {
+ "dictation": {
+ "title": "听写使用 Silero VAD",
+ "description": "为本地听写启用语音活动检测"
+ },
+ "noteRecording": {
+ "title": "笔记录音使用 Silero VAD",
+ "description": "为本地笔记录音启用语音活动检测"
+ },
+ "meeting": {
+ "title": "会议使用 Silero VAD",
+ "description": "为本地会议转录启用语音活动检测"
+ }
+ },
+ "fields": {
+ "threshold": {
+ "label": "VAD 阈值",
+ "info": "高于该概率的帧会被判定为语音。"
+ },
+ "minSpeechDurationMs": {
+ "label": "最小语音时长 (毫秒)",
+ "info": "短于此时长的语音片段会作为噪声或误判被丢弃。"
+ },
+ "minSilenceDurationMs": {
+ "label": "最小静音时长 (毫秒)",
+ "info": "静音必须达到该时长才会结束一个语音片段。更短的停顿会保留在片段内。"
+ },
+ "maxSpeechDurationS": {
+ "label": "最大语音时长 (秒)",
+ "info": "更长的片段会在静音处自动拆分,以便保持可控大小。"
+ },
+ "speechPadMs": {
+ "label": "语音填充 (毫秒)",
+ "info": "在每个语音片段前后添加的填充,避免切断词语边缘。"
+ },
+ "samplesOverlap": {
+ "label": "样本重叠 (秒)",
+ "info": "将每个片段延伸到下一个片段的音频量,避免拼接时出现突兀的截断。"
+ }
+ }
+ }
},
"intelligence": {
"gpuDevice": {
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index 335920784..d07d5ce7c 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -1542,7 +1542,51 @@
"deleteModels": "刪除模型"
},
"transcriptionPreview": "即時轉錄預覽",
- "transcriptionPreviewDescription": "在浮動視窗中顯示轉錄結果,再進行文字整理"
+ "transcriptionPreviewDescription": "在浮動視窗中顯示轉錄結果,再進行文字整理",
+ "vad": {
+ "title": "語音活動偵測",
+ "description": "設定 Silero VAD 如何為本機 Whisper 轉錄偵測並切分語音",
+ "toggles": {
+ "dictation": {
+ "title": "聽寫使用 Silero VAD",
+ "description": "為本機聽寫啟用語音活動偵測"
+ },
+ "noteRecording": {
+ "title": "筆記錄音使用 Silero VAD",
+ "description": "為本機筆記錄音啟用語音活動偵測"
+ },
+ "meeting": {
+ "title": "會議使用 Silero VAD",
+ "description": "為本機會議轉錄啟用語音活動偵測"
+ }
+ },
+ "fields": {
+ "threshold": {
+ "label": "VAD 閾值",
+ "info": "高於此機率的音框會被判定為語音。"
+ },
+ "minSpeechDurationMs": {
+ "label": "最小語音時長 (毫秒)",
+ "info": "短於此時長的語音片段會作為雜訊或誤判被丟棄。"
+ },
+ "minSilenceDurationMs": {
+ "label": "最小靜音時長 (毫秒)",
+ "info": "靜音需達到此時長才會結束一個語音片段。較短的停頓會保留在片段內。"
+ },
+ "maxSpeechDurationS": {
+ "label": "最大語音時長 (秒)",
+ "info": "較長的片段會在靜音處自動切分,以便保持可控大小。"
+ },
+ "speechPadMs": {
+ "label": "語音填補 (毫秒)",
+ "info": "在每個語音片段前後加入的填補量,避免切到字詞邊緣。"
+ },
+ "samplesOverlap": {
+ "label": "樣本重疊 (秒)",
+ "info": "將每個片段延伸到下一個片段的音訊量,避免拼接時出現突兀截斷。"
+ }
+ }
+ }
},
"intelligence": {
"gpuDevice": {
diff --git a/src/stores/settingsStore.ts b/src/stores/settingsStore.ts
index 08f47cbca..a8739d55b 100644
--- a/src/stores/settingsStore.ts
+++ b/src/stores/settingsStore.ts
@@ -5,6 +5,7 @@ import { hasStoredByokKey } from "../utils/byokDetection";
import { ensureAgentNameInDictionary } from "../utils/agentName";
import { useStreamingProvidersStore } from "./streamingProvidersStore";
import logger from "../utils/logger";
+import whisperVadConstants from "../constants/whisperVad.json";
import type { LocalTranscriptionProvider, InferenceMode, SelfHostedType } from "../types/electron";
import type { GoogleCalendarAccount } from "../types/calendar";
import { PROMPT_KIND_LIST, type PromptKind } from "../config/prompts/registry";
@@ -119,6 +120,9 @@ const BOOLEAN_SETTINGS = new Set([
"meetingProcessDetection",
"meetingAudioDetection",
"speakerDiarizationEnabled",
+ "dictationSileroEnabled",
+ "noteRecordingSileroEnabled",
+ "meetingSileroEnabled",
"isSignedIn",
"autoPasteEnabled",
"keepTranscriptionInClipboard",
@@ -133,7 +137,29 @@ const BOOLEAN_SETTINGS = new Set([
const ARRAY_SETTINGS = new Set(["customDictionary", "gcalAccounts"]);
-const NUMERIC_SETTINGS = new Set(["audioRetentionDays"]);
+const NUMERIC_SETTINGS = new Set([
+ "audioRetentionDays",
+ "whisperVadThreshold",
+ "whisperVadMinSpeechDurationMs",
+ "whisperVadMinSilenceDurationMs",
+ "whisperVadMaxSpeechDurationS",
+ "whisperVadSpeechPadMs",
+ "whisperVadSamplesOverlap",
+]);
+
+const WHISPER_VAD_DEFAULTS = whisperVadConstants.DEFAULTS;
+const WHISPER_VAD_LIMITS = whisperVadConstants.LIMITS;
+
+type WhisperVadKey = keyof typeof WHISPER_VAD_DEFAULTS;
+
+const clampVadValue = (key: WhisperVadKey, raw: unknown): number => {
+ const fallback = WHISPER_VAD_DEFAULTS[key];
+ const n = raw === null || raw === undefined || raw === "" ? fallback : Number(raw);
+ if (!Number.isFinite(n)) return fallback;
+ const { min, max, round } = WHISPER_VAD_LIMITS[key];
+ const clamped = Math.min(max, Math.max(min, n));
+ return round ? Math.round(clamped) : clamped;
+};
const LANGUAGE_MIGRATIONS: Record<string, string> = { zh: "zh-CN" };
@@ -328,6 +354,15 @@ export interface SettingsState
meetingProcessDetection: boolean;
meetingAudioDetection: boolean;
speakerDiarizationEnabled: boolean;
+ dictationSileroEnabled: boolean;
+ noteRecordingSileroEnabled: boolean;
+ meetingSileroEnabled: boolean;
+ whisperVadThreshold: number;
+ whisperVadMinSpeechDurationMs: number;
+ whisperVadMinSilenceDurationMs: number;
+ whisperVadMaxSpeechDurationS: number;
+ whisperVadSpeechPadMs: number;
+ whisperVadSamplesOverlap: number;
panelStartPosition: "bottom-right" | "center" | "bottom-left";
showTranscriptionPreview: boolean;
autoPasteEnabled: boolean;
@@ -498,6 +533,15 @@ export interface SettingsState
setMeetingProcessDetection: (value: boolean) => void;
setMeetingAudioDetection: (value: boolean) => void;
setSpeakerDiarizationEnabled: (value: boolean) => void;
+ setDictationSileroEnabled: (value: boolean) => void;
+ setNoteRecordingSileroEnabled: (value: boolean) => void;
+ setMeetingSileroEnabled: (value: boolean) => void;
+ setWhisperVadThreshold: (value: number) => void;
+ setWhisperVadMinSpeechDurationMs: (value: number) => void;
+ setWhisperVadMinSilenceDurationMs: (value: number) => void;
+ setWhisperVadMaxSpeechDurationS: (value: number) => void;
+ setWhisperVadSpeechPadMs: (value: number) => void;
+ setWhisperVadSamplesOverlap: (value: number) => void;
setPanelStartPosition: (position: "bottom-right" | "center" | "bottom-left") => void;
setShowTranscriptionPreview: (value: boolean) => void;
setAutoPasteEnabled: (value: boolean) => void;
@@ -727,6 +771,27 @@ export const useSettingsStore = create<SettingsState>()((set, get) => ({
meetingProcessDetection: readBoolean("meetingProcessDetection", true),
meetingAudioDetection: readBoolean("meetingAudioDetection", true),
speakerDiarizationEnabled: readBoolean("speakerDiarizationEnabled", true),
+ dictationSileroEnabled: readBoolean("dictationSileroEnabled", true),
+ noteRecordingSileroEnabled: readBoolean("noteRecordingSileroEnabled", true),
+ meetingSileroEnabled: readBoolean("meetingSileroEnabled", true),
+ whisperVadThreshold: clampVadValue("threshold", readString("whisperVadThreshold", "0.5")),
+ whisperVadMinSpeechDurationMs: clampVadValue(
+ "minSpeechDurationMs",
+ readString("whisperVadMinSpeechDurationMs", "250")
+ ),
+ whisperVadMinSilenceDurationMs: clampVadValue(
+ "minSilenceDurationMs",
+ readString("whisperVadMinSilenceDurationMs", "200")
+ ),
+ whisperVadMaxSpeechDurationS: clampVadValue(
+ "maxSpeechDurationS",
+ readString("whisperVadMaxSpeechDurationS", "30")
+ ),
+ whisperVadSpeechPadMs: clampVadValue("speechPadMs", readString("whisperVadSpeechPadMs", "100")),
+ whisperVadSamplesOverlap: clampVadValue(
+ "samplesOverlap",
+ readString("whisperVadSamplesOverlap", "0.5")
+ ),
panelStartPosition: (() => {
const v = readString("panelStartPosition", "bottom-right");
if (v === "bottom-right" || v === "center" || v === "bottom-left") return v;
@@ -1161,6 +1226,75 @@ export const useSettingsStore = create<SettingsState>()((set, get) => ({
window.electronAPI?.setSpeakerDiarizationEnabled?.(value);
}
},
+ setDictationSileroEnabled: (value: boolean) => {
+ if (isBrowser) localStorage.setItem("dictationSileroEnabled", String(value));
+ useSettingsStore.setState({ dictationSileroEnabled: value });
+ if (isBrowser) {
+ window.electronAPI?.setWhisperVadConfig?.({ dictationSileroEnabled: value });
+ }
+ },
+ setNoteRecordingSileroEnabled: (value: boolean) => {
+ if (isBrowser) localStorage.setItem("noteRecordingSileroEnabled", String(value));
+ useSettingsStore.setState({ noteRecordingSileroEnabled: value });
+ if (isBrowser) {
+ window.electronAPI?.setWhisperVadConfig?.({ noteRecordingSileroEnabled: value });
+ }
+ },
+ setMeetingSileroEnabled: (value: boolean) => {
+ if (isBrowser) localStorage.setItem("meetingSileroEnabled", String(value));
+ useSettingsStore.setState({ meetingSileroEnabled: value });
+ if (isBrowser) {
+ window.electronAPI?.setWhisperVadConfig?.({ meetingSileroEnabled: value });
+ }
+ },
+ setWhisperVadThreshold: (value: number) => {
+ const next = clampVadValue("threshold", value);
+ if (isBrowser) localStorage.setItem("whisperVadThreshold", String(next));
+ useSettingsStore.setState({ whisperVadThreshold: next });
+ if (isBrowser) {
+ window.electronAPI?.setWhisperVadConfig?.({ threshold: next });
+ }
+ },
+ setWhisperVadMinSpeechDurationMs: (value: number) => {
+ const next = clampVadValue("minSpeechDurationMs", value);
+ if (isBrowser) localStorage.setItem("whisperVadMinSpeechDurationMs", String(next));
+ useSettingsStore.setState({ whisperVadMinSpeechDurationMs: next });
+ if (isBrowser) {
+ window.electronAPI?.setWhisperVadConfig?.({ minSpeechDurationMs: next });
+ }
+ },
+ setWhisperVadMinSilenceDurationMs: (value: number) => {
+ const next = clampVadValue("minSilenceDurationMs", value);
+ if (isBrowser) localStorage.setItem("whisperVadMinSilenceDurationMs", String(next));
+ useSettingsStore.setState({ whisperVadMinSilenceDurationMs: next });
+ if (isBrowser) {
+ window.electronAPI?.setWhisperVadConfig?.({ minSilenceDurationMs: next });
+ }
+ },
+ setWhisperVadMaxSpeechDurationS: (value: number) => {
+ const next = clampVadValue("maxSpeechDurationS", value);
+ if (isBrowser) localStorage.setItem("whisperVadMaxSpeechDurationS", String(next));
+ useSettingsStore.setState({ whisperVadMaxSpeechDurationS: next });
+ if (isBrowser) {
+ window.electronAPI?.setWhisperVadConfig?.({ maxSpeechDurationS: next });
+ }
+ },
+ setWhisperVadSpeechPadMs: (value: number) => {
+ const next = clampVadValue("speechPadMs", value);
+ if (isBrowser) localStorage.setItem("whisperVadSpeechPadMs", String(next));
+ useSettingsStore.setState({ whisperVadSpeechPadMs: next });
+ if (isBrowser) {
+ window.electronAPI?.setWhisperVadConfig?.({ speechPadMs: next });
+ }
+ },
+ setWhisperVadSamplesOverlap: (value: number) => {
+ const next = clampVadValue("samplesOverlap", value);
+ if (isBrowser) localStorage.setItem("whisperVadSamplesOverlap", String(next));
+ useSettingsStore.setState({ whisperVadSamplesOverlap: next });
+ if (isBrowser) {
+ window.electronAPI?.setWhisperVadConfig?.({ samplesOverlap: next });
+ }
+ },
setPanelStartPosition: (position: "bottom-right" | "center" | "bottom-left") => {
if (get().panelStartPosition === position) return;
if (isBrowser) localStorage.setItem("panelStartPosition", position);
@@ -1658,6 +1792,27 @@ export async function initializeSettings(): Promise<void> {
);
}
+ try {
+ const currentState = useSettingsStore.getState();
+ await window.electronAPI.setWhisperVadConfig?.({
+ dictationSileroEnabled: currentState.dictationSileroEnabled,
+ noteRecordingSileroEnabled: currentState.noteRecordingSileroEnabled,
+ meetingSileroEnabled: currentState.meetingSileroEnabled,
+ threshold: currentState.whisperVadThreshold,
+ minSpeechDurationMs: currentState.whisperVadMinSpeechDurationMs,
+ minSilenceDurationMs: currentState.whisperVadMinSilenceDurationMs,
+ maxSpeechDurationS: currentState.whisperVadMaxSpeechDurationS,
+ speechPadMs: currentState.whisperVadSpeechPadMs,
+ samplesOverlap: currentState.whisperVadSamplesOverlap,
+ });
+ } catch (err) {
+ logger.warn(
+ "Failed to sync whisper VAD config on startup",
+ { error: (err as Error).message },
+ "settings"
+ );
+ }
+
ensureAgentNameInDictionary();
}
@@ -1691,8 +1846,13 @@ export async function initializeSettings(): Promise<void> {
value = [];
}
} else if (NUMERIC_SETTINGS.has(key)) {
- const parsed = parseInt(newValue, 10);
- value = isNaN(parsed) ? 30 : parsed;
+ const parsed = Number(newValue);
+ if (Number.isNaN(parsed)) {
+ value =
+ key === "audioRetentionDays" ? 30 : (state as unknown as Record<string, unknown>)[key];
+ } else {
+ value = key === "audioRetentionDays" ? Math.round(parsed) : parsed;
+ }
} else {
value = newValue;
}
diff --git a/src/types/electron.ts b/src/types/electron.ts
index 66ad05874..805a7bc74 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -1586,6 +1586,32 @@ declare global {
enabled: boolean;
expectedCount: number;
}) => Promise<{ success: boolean; error?: string }>;
+ getWhisperVadConfig?: () => Promise<{
+ success: boolean;
+ config?: {
+ dictationSileroEnabled: boolean;
+ noteRecordingSileroEnabled: boolean;
+ meetingSileroEnabled: boolean;
+ threshold: number;
+ minSpeechDurationMs: number;
+ minSilenceDurationMs: number;
+ maxSpeechDurationS: number;
+ speechPadMs: number;
+ samplesOverlap: number;
+ };
+ error?: string;
+ }>;
+ setWhisperVadConfig?: (config: {
+ dictationSileroEnabled?: boolean;
+ noteRecordingSileroEnabled?: boolean;
+ meetingSileroEnabled?: boolean;
+ threshold?: number;
+ minSpeechDurationMs?: number;
+ minSilenceDurationMs?: number;
+ maxSpeechDurationS?: number;
+ speechPadMs?: number;
+ samplesOverlap?: number;
+ }) => Promise<{ success: boolean; config?: Record<string, unknown>; error?: string }>;
onMeetingDetected?: (callback: (data: any) => void) => () => void;
onMeetingDetectedStartRecording?: (callback: (data: any) => void) => () => void;
onMeetingNotificationData?: (callback: (data: any) => void) => () => void;
diff --git a/test/helpers/whisperServerVadArgs.test.js b/test/helpers/whisperServerVadArgs.test.js
new file mode 100644
index 000000000..abf87129d
--- /dev/null
+++ b/test/helpers/whisperServerVadArgs.test.js
@@ -0,0 +1,88 @@
+const test = require("node:test");
+const assert = require("node:assert/strict");
+
+const WhisperServerManager = require("../../src/helpers/whisperServer");
+
+test("buildWhisperServerArgs includes VAD flags when enabled and model path provided", () => {
+ const args = WhisperServerManager.buildWhisperServerArgs({
+ modelPath: "/tmp/model.bin",
+ port: 8180,
+ language: "auto",
+ vadEnabled: true,
+ vadModelPath: "/tmp/ggml-silero-v5.1.2.bin",
+ vadConfig: {
+ threshold: 0.3,
+ minSpeechDurationMs: 180,
+ minSilenceDurationMs: 250,
+ maxSpeechDurationS: 24,
+ speechPadMs: 120,
+ samplesOverlap: 0.42,
+ },
+ });
+
+ assert.deepEqual(args, [
+ "--model",
+ "/tmp/model.bin",
+ "--host",
+ "127.0.0.1",
+ "--port",
+ "8180",
+ "--language",
+ "auto",
+ "--vad",
+ "--vad-model",
+ "/tmp/ggml-silero-v5.1.2.bin",
+ "--vad-threshold",
+ "0.3",
+ "--vad-min-speech-duration-ms",
+ "180",
+ "--vad-min-silence-duration-ms",
+ "250",
+ "--vad-max-speech-duration-s",
+ "24",
+ "--vad-speech-pad-ms",
+ "120",
+ "--vad-samples-overlap",
+ "0.42",
+ ]);
+});
+
+test("buildWhisperServerArgs omits VAD flags when vadModelPath is missing", () => {
+ const args = WhisperServerManager.buildWhisperServerArgs({
+ modelPath: "/tmp/model.bin",
+ port: 8180,
+ language: "auto",
+ vadEnabled: true,
+ vadModelPath: null,
+ });
+
+ assert.equal(args.includes("--vad"), false);
+ assert.equal(args.includes("--vad-model"), false);
+});
+
+test("getVadSignature changes when VAD settings or model path change", () => {
+ const a = WhisperServerManager.getVadSignature({
+ vadEnabled: true,
+ vadModelPath: "/m.bin",
+ vadConfig: { threshold: 0.5 },
+ });
+ const b = WhisperServerManager.getVadSignature({
+ vadEnabled: true,
+ vadModelPath: "/m.bin",
+ vadConfig: { threshold: 0.6 },
+ });
+ const c = WhisperServerManager.getVadSignature({
+ vadEnabled: false,
+ vadModelPath: "/m.bin",
+ vadConfig: { threshold: 0.6 },
+ });
+ const d = WhisperServerManager.getVadSignature({
+ vadEnabled: true,
+ vadModelPath: null,
+ vadConfig: { threshold: 0.5 },
+ });
+
+ assert.notEqual(a, b);
+ assert.notEqual(b, c);
+ assert.equal(c, d);
+});
diff --git a/test/helpers/whisperVadConfig.test.js b/test/helpers/whisperVadConfig.test.js
new file mode 100644
index 000000000..0326295b4
--- /dev/null
+++ b/test/helpers/whisperVadConfig.test.js
@@ -0,0 +1,37 @@
+const test = require("node:test");
+const assert = require("node:assert/strict");
+
+test("sanitizeWhisperVadConfig applies defaults and clamps invalid values", async () => {
+ const { DEFAULT_WHISPER_VAD_CONFIG, sanitizeWhisperVadConfig } = await import(
+ "../../src/helpers/whisperVadConfig.js"
+ );
+
+ const cfg = sanitizeWhisperVadConfig({
+ threshold: 99,
+ minSpeechDurationMs: -20,
+ minSilenceDurationMs: "bad",
+ maxSpeechDurationS: 0,
+ speechPadMs: null,
+ samplesOverlap: -1,
+ });
+
+ assert.deepEqual(cfg, {
+ threshold: 0.95,
+ minSpeechDurationMs: 50,
+ minSilenceDurationMs: DEFAULT_WHISPER_VAD_CONFIG.minSilenceDurationMs,
+ maxSpeechDurationS: 5,
+ speechPadMs: DEFAULT_WHISPER_VAD_CONFIG.speechPadMs,
+ samplesOverlap: 0,
+ });
+});
+
+test("resolveContextSileroEnabled prefers context value then falls back to true", async () => {
+ const { resolveContextSileroEnabled } = await import("../../src/helpers/whisperVadConfig.js");
+
+ assert.equal(resolveContextSileroEnabled({ dictationSileroEnabled: false }, "dictation"), false);
+ assert.equal(
+ resolveContextSileroEnabled({ noteRecordingSileroEnabled: true }, "noteRecording"),
+ true
+ );
+ assert.equal(resolveContextSileroEnabled({}, "meeting"), true);
+});