You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(windows): native speech recognizer via System.Speech + fix binary paths
Root causes of broken Windows dictation:
1. hotkey-hold-monitor.exe path wrong: windows.ts compiles to
dist/main/platform/ so __dirname/../native = dist/main/native (not found).
Fixed to go up two levels so the path resolves to dist/native/.
2. Web Speech API ('webspeech' backend) fails with 'network' error in
Electron because Electron builds do not include Google's API keys that
Chrome embeds. Switched to the 'native' backend on all platforms.
3. Windows has no native speech binary. Added speech-recognizer.cs — a
C# console app using System.Speech.Recognition (built into .NET
Framework 4.x, available on every Windows 10/11 machine, works fully
offline with no API key). Protocol: emits {"ready":true},
{"transcript":"...","isFinal":true|false}, {"error":"..."} JSON lines
to stdout, same as the macOS Swift binary.
4. whisper-start-native in main.ts used 'speech-recognizer' (no .exe) on
all platforms; Windows needs 'speech-recognizer.exe'. Added platform
check. On-demand compile fallback now uses csc.exe + the WPF-subfolder
System.Speech.dll path on Windows.
build-native.js changes:
- Add C# compilation step using C:\Windows\Microsoft.NET\Framework64\
v4.0.30319\csc.exe with System.Speech.dll from the WPF subfolder.
- Both hotkey-hold-monitor.exe and speech-recognizer.exe are now built
by `npm run build:native`.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments