Voice Mode
unlistedby qishuilalala
Offline-first bilingual voice dictation, Markdown-aware read-aloud, and optional BYOK voice Q&A.
Voice Mode
English | 简体中文
Source build (
0.1.0) · The GitHub Release and Obsidian Community Plugin Directory submission are pending. Build the plugin locally to try it.Features covered by the M0–M6 acceptance records:
- Desktop 100% offline WASM dictation (
SenseVoice WASM): Isolated MEMFS Web Worker runningSilero VAD+SenseVoice int8(sherpa-onnx@2.0.2) acrosstoggle,single(Dictate single utterance), andpush-to-talkmodes, with configurable idle Worker auto-unload.- Explicit SHA256-verified Vault-external model manager: User-triggered downloads for dictation (
245.3 MB) and optional localvits-zh-llspeech (116.1 MB) with.partHTTP Range resume, mirror failover (huggingface.co/hf-mirror.com+registry.npmjs.org/registry.npmmirror.com), and strict Vault-isolation guard (~/.cache/voice-mode/models//%LOCALAPPDATA%\voice-mode\models\).- Personal vocabulary replacement UI & universal focus injection: Single-pass CJK/English alias replacement UI (
12 KBbudget) andFocusTextInjectorcursor-accurate insertion into CodeMirror 6, core Search, Shadow DOM inputs, and Lexical/ProseMirror sidebars (Copilot 4.0.20).- Spoken Markdown/table read-aloud, subtitle controls & native AEC3 barge-in: System
speechSynthesis, optional desktop offlinevits-wasm(5 speakers), optional localkokoro-daemon(Kokoro 103voices with< 1sauto-fallback, verified at3 ms), and BYOKopenai-compat/ livemimoTTS (SecretStorage+ zero-redirect CORS fallback), paired with size/width subtitle presets, interactive Pause/Resume/Next/Stop controls, automatic stop on note switch, and live native AEC3 hands-free voice barge-in (180 scontinuous speaker playback with0self-interrupts,66–370 ms < 600 msvoice interrupt, automatically lockingmanualonsystemTTS).- Optional BYOK voice Q&A, 4-guard transcript polish & cloud ASR (
SecretStorage): GroundedAsk AI about selection or notestreaming modal (with optional spoken reply and cursor insertion), optional post-dictation 4-layer anti-hallucination LLM polish (falling back cleanly to raw text on any error), and zero-WASMopenai-compat/audio/transcriptionsdictation for desktop & mobile (gated on mobile byAllow cloud fallback on mobile).- Test coverage: Android 15 AVD ran the Obsidian 1.15.1 APK. Xcode’s iOS 27 simulator ran a WKWebView harness. Physical phones have not been verified. The joint daemon test used Obsidian and Chrome MV3. See the acceptance record for the individual checks.
Try it on desktop
- From the repository root, use Node.js
>= 22.18.0andpnpm@12.21.0to runpnpm install --frozen-lockfilefollowed bypnpm run build. - Copy
main.js,manifest.json, andstyles.cssinto your vault’s.obsidian/plugins/voice-mode/folder. Reload Obsidian, open Settings → Community plugins, and enable Voice Mode. - Select a paragraph and run
Read selection or note aloudfrom the command palette. For offline dictation, useDownload or verify modelsin Voice Mode settings and confirmSenseVoice WASM (desktop offline)underRecognition engine. Place the cursor in a note and runDictate single utterance.
Why Voice Mode?
Most Obsidian voice plugins force an awkward trade-off: either require users to manually install and run an external local WebSocket server, upload private notes and audio to third-party cloud services, or read raw Markdown symbols (| --- |, code fences, URLs) aloud verbatim.
Voice Mode (id: voice-mode, minAppVersion: 1.11.4) is designed as an offline-first, zero-external-server voice I/O layer that works alongside your existing AI plugins (such as Copilot or Smart Connections) rather than replacing them:
- Zero external server by default (Implemented in M1): Desktop offline bilingual (Chinese/English) dictation running in a Web Worker via WASM (
Silero VAD+SenseVoice int8), paired with a custom ASR replacement dictionary UI for domain terms, proper nouns, and[[wikilinks]]. - Editor & third-party sidebar injection (Implemented in M1): Dictate directly into the active Markdown editor or focused third-party sidebars (such as Copilot's Lexical input box) without tight coupling or OS clipboard pollution.
- Markdown & pipe-table aware read-aloud (Implemented in M2): Strips YAML frontmatter, fenced code blocks (
```/~~~), math blocks ($$...$$), bare URLs, Obsidian callout markers, and Markdown pipe tables while cleaning inline code and Wikilink syntax into natural spoken text—paired with configurable floating captions (small/medium/largefont,narrow/medium/widewidth, Pause/Next/Stop controls), optional localvits-wasm/ BYOK TTS, and native AEC3 hands-free barge-in (with automaticmanualfallback). - Optional zero-dependency BYOK Q&A, 4-guard polish & cloud ASR (Implemented in M3): Supports OpenAI-compatible endpoints (DeepSeek, Qwen/DashScope, Doubao/Ark, Kimi, SiliconFlow, OpenRouter, OpenAI, Ollama) and Anthropic Messages using Obsidian's native
SecretStorage(>= 1.11.4), plus OpenAI-compatible/audio/transcriptionsdictation. - Optional shared local
voice-daemon(Implemented in Wave 3 —voice-mode-daemon): For desktop power users who want nativeKokoro 103voices (<whisper>/<break>emotion synthesis) and single-instance model sharing (Obsidian and Chrome MV3 measured at622.7 MBRSS) without hitting Electron's V8 Memory Cage, with< 1s(3 msmeasured) automatic fallback when offline.
Architecture & Packages
This repository is structured as a three-package pnpm monorepo so core speech logic stays cleanly separated from Obsidian APIs and can power our broader cross-platform Voice Mode series:
| Package | Role | Host Dependencies |
|---|---|---|
packages/voice-core (@voice-mode/core) | Zero-dependency pure TypeScript speech pipeline: Markdown/table TTS segmenter, ASR replacement dictionary, emotion tag DSL, pinned model/WASM SHA256 manifest & USTAR tar extractor, OpenAiCompatAsrTransport, OpenAiCompatTtsEngine / MimoTtsEngine + sniffAudioMime, secret redaction, and < 400-line dual-protocol BYOK LLM router | None (no obsidian, no electron, no node:*) |
packages/voice-browser (@voice-mode/browser) | Web Audio / Electron contracts: 16 kHz AudioWorklet resampler, native AEC3 runtime probe & AecBargeInMonitor, pause/skip PlaybackQueue, MEMFS Sherpa Web Worker runtime/client, VitsWasmTtsEngine, offline dictation session, and zero-WASM CloudDictationSession (640 ms pre-roll + endpointing) | Web / Audio standards only (no obsidian) |
packages/obsidian-plugin (@voice-mode/obsidian-plugin) | Thin Obsidian adapter bundled via esbuild into repo-root main.js (build limit below 5 MiB) | obsidian (minAppVersion: 1.11.4) |
Verified In-Obsidian Web Worker WASM Benchmarks (M0, M1 & M2 Gates Passed · 2026-11-22)
Measured inside real Obsidian 1.15.1 (Electron 43.8.9 / Chromium 150.0.7871.250) on Apple M2 Max macOS 27.2.1 (32 GB RAM) using sherpa-onnx@2.0.2 WASM in an isolated MEMFS Web Worker over a 15-minute (60-utterance) continuous session and M1 end-to-end plugin dictation (full report in docs/qa/acceptance-checklist.md):
| Engine / Model (WASM) | Cold Load | RTF | Resident RSS Delta | Role |
|---|---|---|---|---|
Silero VAD | 30 ms | — | Included below | Always-on endpoint / barge-in VAD |
SenseVoice int8 | 485 ms | 0.215 (15m avg) | +348.7 MB steady (+527.5 MB peak, 512 MB flat WASM heap) | Default desktop single-model offline dictation (M1) |
Zipformer2 | 1,939 ms (Node ref) | 0.259 | 463 MB (Node ref) | Optional streaming / Wave 3 voice-daemon |
VITS (vits-zh-ll) | 391 ms | 1.268 | 438 MB (80-sentence steady) | Optional desktop offline TTS (M2; #3960 keeps Kokoro on Wave 3 voice-daemon) |
Platform Support & Mobile Degradation
| Platform | Target Support | Runtime Behavior |
|---|---|---|
Desktop (macOS / Windows / Linux, Obsidian >= 1.11.4) | Primary (macOS M0–M6 verified, incl. live voice-daemon joint E2E) | Supports Web Worker offline WASM dictation (SenseVoice WASM), multi-engine read-aloud (system, optional local vits-wasm / kokoro-daemon, BYOK openai-compat / live mimo) + native AEC3 barge-in, and optional BYOK voice Q&A (VoiceQaModal), 4-guard transcript polish, & openai-compat / daemon ASR |
Mobile (iOS / Android, Obsidian >= 1.11.4) | Graceful degradation (isDesktopOnly: false; verified on Android 15 AVD Emulator Obsidian 1.15.1 APK & Xcode iOS 27.0 Simulator WKWebView harness) | Heavy 200 MB+ local WASM models are disabled under Platform.isMobile to reduce memory pressure. The tested iOS simulator exposed native speechSynthesis (68 voices), whereas Android System WebView (124.0) omits window.speechSynthesis (cleanly prompting BYOK TTS while exposing webkitSpeechRecognition), gated by allowCloudFallbackOnMobile (default false) |
Privacy, Network Access & External Model Disclosure
In compliance with Obsidian Developer Policies, all network behavior, model downloads, and credential boundaries are disclosed up front (full details in SECURITY.md):
- Zero telemetry & zero startup calls: The plugin never phones home, collects analytics, or downloads files silently on load.
- Available dictation, read-aloud & voice Q&A commands:
Toggle voice dictation/Dictate single utteranceon desktop withSenseVoice WASMruns 100% locally in an isolated Web Worker with zero network calls. WhenOpenAI-compatible(openai-compat) is explicitly selected, 16 kHz utterance WAV audio is uploaded to your configured/audio/transcriptionsendpoint. When left onSystem speech recognition, it falls back to hostSpeechRecognitiononly if the host provides it (unavailable on desktop Electron without a Google Speech API key; on supporting browsers/WebViews, audio is transmitted by the host runtime to that browser/OS speech provider).Read selection or note alouddefaults to hostwindow.speechSynthesis, and supports optional local desktopVITS WASM(100%offline) or user-configured BYOKOpenAI-compatible/MiMoTTS endpoints.Ask AI about selection or noteandPost-dictation LLM polishare disabled by default (enableVoiceQa: false,enableLlmPolish: false). Only when enabled do they send the active selection (or bounded active note up to24,000chars) and question, or a single dictated utterance for 4-guard cleanup, to your configured LLM endpoint.
- Explicit user-triggered model downloads (Desktop, Implemented in M1/M2):
- Desktop offline models are downloaded only after explicit user action in Settings from disclosed HTTPS hosts: model weights (
Silero VAD,SenseVoice int8, optionalVITS) fromhttps://huggingface.coor optional mirrorhttps://hf-mirror.com, and thesherpa-onnx@2.0.2WASM runtime (Apache-2.0) fromhttps://registry.npmjs.orgorhttps://registry.npmmirror.com(cdn.npmmirror.com), all verified against pinned SHA256 checksums and hop-by-hop redirect allowlists. - Downloaded models (
245.3 MBdictation stack; optional116.1 MBVITS stack) are stored outside your Vault (~/.cache/voice-mode/models/on macOS/Linux,%LOCALAPPDATA%\voice-mode\models\on Windows, or a validated external path) so large files never sync through Obsidian Sync, iCloud, or Git.
- Desktop offline models are downloaded only after explicit user action in Settings from disclosed HTTPS hosts: model weights (
- Optional BYOK endpoints (BYOK TTS, LLM Q&A, 4-guard polish & STT implemented in M2/M3 — all opt-in):
- Outbound TTS/LLM/STT requests occur only when you configure an endpoint and invoke or enable a BYOK feature (
/audio/speech,/audio/transcriptions,/chat/completions,/messages, local loopback HTTP servers such as Ollama / LM Studio, or XiaomiMiMohttps://api.xiaomimimo.com/v1/chat/completions). On mobile, non-loopback cloud requests are blocked unlessAllow cloud fallback on mobile(default: false) is enabled. Requests go directly from Obsidian to your chosen provider—no intermediate proxy operated by this project. - API keys are stored exclusively in Obsidian's built-in
app.secretStorage(>= 1.11.4) and are never written todata.json. Authenticated requests enforceredirect: 'error'and redact secrets before truncating errors.
- Outbound TTS/LLM/STT requests occur only when you configure an endpoint and invoke or enable a BYOK feature (
- Permissions: Microphone access is requested only when you actively trigger voice dictation or barge-in listening.
- License isolation: Source code in this repository is MIT-licensed. No third-party model weights or GPL-3.0
espeak-ng-dataphoneme archives are bundled in git or GitHub Releases; any runtime-downloaded model files retain their respective upstream licenses (SenseVoice: FunAudioLLM;sherpa-onnx/ Kokoro: Apache-2.0;espeak-ng-data: GPL-3.0).
Local Development & Verification
Requires Node.js >= 22.18.0 (workspace tests import .ts directly via Node native type-stripping; CI runs Node 22) and pnpm@12.21.0:
pnpm install --frozen-lockfile
pnpm run check:all
pnpm run check:all executes typecheck, lint (including eslint-plugin-obsidianmd), test, build, and check:release. See CONTRIBUTING.md and CONTEXT.md for package boundaries and testing rules.
Roadmap & Open-Source Voice Mode Matrix
- M0 (Completed · 2026-11-22): 6 real-machine Spikes passed in Obsidian
1.15.1(Electron 43.8.9) — Worker WASM 15-min RSS/RTF, Vault-external cache, Copilot4.0.20Lexical sidebar injection, API CORS & loopback SSE matrix,sherpa-onnx@2.0.2#3960/#1939verification, and native AEC3 /SecretStorageprobes. - M1 (Completed · 2026-11-22): Desktop offline WASM dictation (
Silero VAD+SenseVoice int8), SHA256 Vault-external model manager, personal vocabulary replacement UI, and CM6 / Copilot Lexical injection. - M2 (Completed · 2026-11-22): Markdown/table-aware spoken read-aloud, captions size/width presets & Pause/Next/Stop controls, optional
vits-wasm/ BYOK TTS (openai-compat,mimo), and live native AEC3 barge-in (180 szero-self-interrupt soak,66–370 msvoice interrupt) &manualfallback. - M3 & M4 (Completed · 2026-11-22): BYOK voice Q&A (
VoiceQaModal), 4-guard transcript polish (enableLlmPolish),openai-compat/audio/transcriptionsdictation (CloudDictationSession),< 1sDaemonClientseam, 401/500 secret redaction audit, desktop acoustic gates (A-1–A-4), liveMiMoTTS verification, Fresh Empty Vault /BRAT 2.2.0smoke, and mobileM-1–M-5verification on Android 15 AVD Emulator (Obsidian 1.15.1APK, System WebView124.0) + XcodeiOS 27.0SimulatorWKWebViewharness (main.js284.13 KB,166unit tests; ready forobsidianmd/obsidian-releasessubmission, with physical phones outside the recorded test coverage). - Wave 2 (
M5· Completed · 2026-11-22):sillytavern-voice-mode(0.1.0, commitb792551) — SillyTavern1.19.1UI extension reusing75.05%of@voice-mode/{core,browser}@0.1.0(firstSentenceLeadMs = 341 ms,20/20native AEC3detectbarge-in +stopGeneration()at avg205 ms < 600 ms, charactervoiceMapdrawer, cross-sentence<whisper>emotion DSL, and optional SSRF-hardened server plugin). - Wave 3 (
M6· Completed · 2026-11-22):voice-mode-daemon(0.1.0, commit29ca1f9) —@voice-mode/daemon(127.0.0.1:18790,sk-vmd-192-bit0o600Bearer auth +Host/Originallowlist, nativesherpa-onnx-nodeunlockingKokoro 103voices +Zipformer2+SenseVoice) + zero-<all_urls>Chrome/Edge MV3@voice-mode/browser-extension(joint E2E verified across real Obsidian1.15.1+ Chrome159sharingmodelInstanceCount = 1at622.7 MBRSS,<whisper>+<break 250ms>24 kHzWAV synthesis,631 msdaemonASR, and3 ms < 1,000 msautomatic fallback on daemon stop), plusdsh-voice-modecore unification (-725net duplicated lines across 8 modules,110/110test files green).
See docs/plan/master-plan.md and docs/adr/README.md for full details.
License
MIT © 2026 qishuilalala
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.