Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Text to Speech PreviewNew to Visual Studio Code? Get it now.
Text to Speech Preview

Text to Speech Preview

Preview

Dhakshinamoorthy A

| (0) | Free
Preview selected text or the active document with local system voices.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Text to Speech Preview for VS Code

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

  1. Open this folder in VS Code.
  2. Press F5 and choose Run TTS Preview Extension if VS Code asks.
  3. In the Extension Development Host, open any text or Markdown file.
  4. Select a passage, or leave the selection empty to use the whole document.
  5. Press Ctrl+Alt+S, or run TTS Preview: Open Text to Speech Preview from the Command Palette.
  6. 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.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft