- Home
- Plugins
- Vision, Voice & Multimodal
- dsh-voice-gemini
dsh-voice-gemini
alifirozjaei/dsh-voice-gemini
Dictation in the composer through Google Gemini, with a real-time model that writes the text while you speak and one-shot models that answer the finished recording, keeping the API key on the Host.
Install
dsh plugin --profile web add github:alifirozjaei/dsh-voice-geminiREADME
dsh-voice-gemini
Voice input for DeepSeek Harness, powered by Google's Gemini API.
A microphone appears in the composer tool row. Press it, speak, press stop: the recording is transcribed and the text lands in your draft, ready to edit before you send. Nothing is submitted for you.
It replaces the experimental local SenseVoice bundle with a cloud model, so it needs no model download, no Python, and no gigabytes of disk — only a free API key from Google AI Studio.
What it does
- Dictate into the draft. The microphone sits beside the model selector. While recording it expands into a live row: elapsed time, input level, stop, cancel. Stop transcribes and inserts at the cursor position captured when you started recording — so typing during a slow request does not move the text.
- Keeps the API key on the Host. The browser records and posts audio; the
Host calls Gemini. The key is stored in the credential file
(
~/.dsh/.credentials.yaml), never in the page and never in the profile YAML. - Writes while you speak. The default real-time model returns each phrase when you pause, and the phrase is inserted into the draft right then — you can keep talking, or edit what already arrived. The last phrases land when you press stop.
- Persian-aware prompt. The transcription prompt asks the model to keep Persian half-spaces (ZWNJ, U+200C) and to leave the spoken language alone. Mixed Persian/English dictation keeps both.
- Editable settings. Settings → General → Voice input (Gemini) holds the key, the model, the language, and optional spelling hints. Changes apply without restarting.
- No silent failures. Every failure has a sentence: bad key, rate limit, busy model, refused microphone permission, no speech, unreachable Host.
Requirements
| Harness | DeepSeek Harness with the Web GUI (0.2.x) |
| Key | A Google AI Studio key — https://aistudio.google.com → Get API key (free tier) |
| Permission | Microphone access for the Harness page |
| Network | The Host must reach generativelanguage.googleapis.com (a proxy configured for the Harness network layer is used automatically) |
Install
From npm, in the Harness profile:
npm install dsh-voice-gemini
Then open Plugins, find Voice input (Gemini), and enable it. For a package you are developing locally, use Plugins → Add plugin with the directory path instead.
After the first install, reload the page once so the browser loads the client bundle.
Configure
- Settings → General → Voice input (Gemini) → Configure.
- Paste the key, press Save. The badge turns from No key to Ready.
- Press Test to confirm the key can see the configured model.
- Optional: choose a model and a language, or add spelling hints such as
DeepSeek Harness, Vazirmatn.
The composer microphone shows a small amber dot until a key is configured; the first click then opens the same key field inline.
Use
- Put the cursor where the dictation should go in the message box.
- Press the microphone.
- Speak. Press the red square to stop (or let the 120-second limit stop it).
- Edit the inserted text, then send as usual.
Esc or switching away from the window cancels a recording. Switching
conversation cancels too: a recording never inserts into another draft.
Models
The default is gemini-3.5-transcribe, a transcription model: it is the
cheapest per minute of audio and it kept Persian half-spaces best in testing.
The settings row also offers:
| Model | When to use it |
|---|---|
gemini-3.5-transcribe-live | Default. Real-time model; same text as its sibling, about 1.5× slower because the recording must be streamed over the real-time protocol |
gemini-3.5-transcribe | Fastest one-shot model: a 25-second dictation returns in ~7 seconds |
gemini-3.5-flash-lite | A general model when the transcription model is rate-limited |
gemini-3.5-flash | Better with unusual names and mixed-language speech |
gemini-3.8-flash | Newest general model; subject to capacity spikes |
gemini-flash-latest | Follows whatever Google marks latest |
gemini-3.5-transcribe-live answers only on the real-time WebSocket protocol
(bidiGenerateContent); a plain generateContent request to it is refused by
Google. The plugin therefore keeps one socket open per dictation, streams the
microphone into it as 16 kHz PCM, and inserts every phrase the model returns.
How it behaves: the plugin cuts the stream into segments itself, because the model's own detector only ends a turn on silence — with it, someone who never pauses would see text only after they stop. A segment ends after 320 ms of silence (a natural pause) or at a 7-second cap for unbroken speech, and the model answers that segment right away. Measured on a 17-second dictation with two pauses: the phrase for audio at 4.9 s reached the page at 4.9 s, three deltas arrived during the recording, and their assembly equalled the final text exactly.
The one-shot models still wait for the finished recording, by design: they take the whole WAV and answer once.
Any model id the key can use may be typed into the custom field.
Listening to system audio
macOS does not expose what the speakers play as a recording device, and the Harness page (Electron) does not implement the screen-capture route, so a browser page cannot hear system audio by itself. The supported route is a loopback device:
- Install BlackHole (
brew install blackhole-2ch). - In Audio MIDI Setup, create a Multi-Output Device that contains both BlackHole and your speakers, so you still hear the audio.
- In the Harness, open Settings → General → Voice input (Gemini) → Configure and choose BlackHole under Audio input.
- Press the microphone when you want it to listen. It is never always-on.
The picker lists the device once BlackHole is installed; before that the row says what is missing.
Microphone permission
The permission dialog appears once per app launch: the plugin keeps one microphone stream for the lifetime of the page and reuses it for every later recording, so pressing the microphone again does not ask. Closing the app, reloading the page, unplugging the device or changing Audio input releases the stream, and the next recording asks again.
The same code path runs on macOS, Windows and Linux; only the wording of a blocked-permission message differs (System Settings on macOS, Privacy & security on Windows, the page's own permission on Linux).
Privacy and data flow
- Audio leaves your machine once, to Google, for the request you started.
- Nothing is written to disk on the Harness side; the recording exists only in memory for the length of one request.
- The key is stored under
GEMINI_API_KEYin the Harness credential store. It is never sent to the page. A key already exported asGEMINI_API_KEYin the environment is used without any configuration. - Turning the plugin off removes the microphone and the settings row; it does not delete the stored key (remove it with Remove in the row, or from the credential file).
Limits: 120 seconds and 8 MiB per recording (both configurable in the row's configuration), mono 16 kHz PCM WAV after browser-side resampling.
How it works
browser: getUserMedia → MediaRecorder → decodeAudioData → 16 kHz mono WAV
→ POST /api/voice-gemini/transcribe
host: credential lookup
├─ one-shot model: POST models/<model>:generateContent (inline audio)
└─ real-time model: one WebSocket per dictation; each turn's phrase
comes back during the recording
browser: inputActions.insertText(phrase, capturedSpan) — per phrase, while
speaking, for the real-time model; once at the end otherwise
Four authenticated routes on the Host under /api/voice-gemini: status,
transcribe, key, and test. They are registered through
ctx.connection.fetch.register, so they inherit the page's owner-only
authentication and are unreachable without it.
Development
node --test tests/ # host routes, validation, retry, prompt
GEMINI_API_KEY=… node tests/live.mjs /path/to/16k-mono.wav [model]
tests/ is not included in the published package.
Limitations
- One recording at a time, and it needs an internet round trip; a 5-second dictation takes roughly 5 seconds to transcribe on the free tier.
- Transcription quality is the model's: unusual proper nouns may need the spelling-hints field.
- Firefox and Safari resample through the same path but were not exercised; Chromium (the Harness desktop shell) is the supported browser.
License
MIT © 2026 Ali L Firozjaei. Gemini is a trademark of Google LLC; this project is not affiliated with or endorsed by Google.
Related plugins
dsh-web-ui (dsh-tool-describe-image)
zhu1090093659/dsh-web-ui
modlens
liustack/modlens
ipollowork
devin-axis/ipollowork
dsh-image-gen
shanliuling/dsh-image-gen