An experimental, local-first VS Code extension for listening to selected text or an active document before publishing, presenting, or sharing it.
The preview opens beside the editor and provides:
Device-local system voice discovery—no account, cloud API, or API key.
Editable text before playback.
Play, pause, resume, and stop controls.
Rate, pitch, and volume controls.
Long-document chunking and playback progress.
Smart cleanup of common Markdown syntax.
A refresh action that copies the latest editor selection or document.
Run the prototype
Open this folder in VS Code.
Press F5 and choose Run TTS Preview Extension if VS Code asks.
In the Extension Development Host, open any text or Markdown file.
Select a passage, or leave the selection empty to use the whole document.
Press Ctrl+Alt+S, or run TTS Preview: Open Text to Speech Preview from the Command Palette.
Choose a system voice and press Play.
Use Refresh from editor after changing the selection or source document.
Settings
ttsPreview.contentMode: smart removes common Markdown markers; raw keeps source text unchanged.
ttsPreview.maxCharacters: limits how much text is copied into the preview. The default is 50,000 characters.
Development checks
The extension has no runtime npm dependencies. With Node.js available:
npm test
npm run check
Current research constraints
Speech is powered by the browser speechSynthesis API inside a VS Code webview. The prototype filters out voices reported as remote services so editor text is not intentionally sent to a network speech provider. Voice availability and boundary/progress events still depend on the operating system and VS Code's Electron runtime, so the extension should be tested on every target OS before publishing.
The next useful experiment is a native speech-provider fallback for environments where webview speech synthesis is unavailable, followed by sentence-level highlighting and optional audio export.