Native Speech Generation for NVDA

Author: Muhammad Gagah muha.aku@gmail.com

Native Speech Generation is an NVDA add-on that integrates Google Gemini AI to generate high-quality, natural-sounding speech directly within NVDA. It provides a clean, fully accessible interface for converting text into audio, supporting both single-speaker narration and dynamic multi-speaker dialogues.

This add-on is designed for smooth workflows, accessibility-first interaction, and flexible voice control suitable for narration, dialogue, and audio content production.


Features

High-Quality Speech Generation

Single & Multi-Speaker Modes

Advanced Voice Control

Accessible & Clean Interface

Seamless Workflow

Smart Voice Loading & Caching

Talk With AI (Live Conversation)


Requirements


Installation

  1. Download the latest add-on package from the Releases page: https://github.com/MuhammadGagah/native-speech-generation/releases
  2. Install it like any standard NVDA add-on.
  3. Restart NVDA when prompted.

API Key Setup (Required)

  1. Create an API key from Google AI Studio: https://aistudio.google.com/apikey
  2. Open NVDA and go to: NVDA Menu → Tools → Native Speech Generation
  3. Click “API Key Settings”.
  4. This opens NVDA Settings directly in the Native Speech Generation category.
  5. Paste your Gemini API Key into the GEMINI API Key field.
  6. Click OK to save.

Saved keys are stored securely using Windows DPAPI, so the encrypted value cannot be decrypted on a different Windows machine or user account.

For advanced deployments, you can also provide the key through the GEMINI_API_KEY environment variable. The add-on will use it automatically when no stored key is available.


How to Use

Open the dialog using:

Main Interface Elements


Generating Speech

Single-Speaker Mode

  1. Select Single-speaker.
  2. Choose a voice from the Select Voice dropdown.
  3. Enter your text.
  4. Optionally add style instructions.
  5. Click Generate Speech.
  6. The audio will play automatically after generation.

Multi-Speaker Mode

  1. Select Multi-speaker (2).
  2. For each speaker:

  3. Enter a unique Speaker Name.

  4. Select a distinct Voice.
  5. Format the text so each line starts with the speaker name followed by a colon.

Example:

Alice: Hi Bob, how are you today? Bob: I'm doing great, Alice! The weather is fantastic.

  1. Click Generate Speech. Voices will be assigned automatically based on the speaker names.

Talk With AI (Live Mode)

Experience a natural, two-way voice conversation with Gemini.

  1. Configure your desired Voice and Style Instructions in the main dialog. (Note: Talk With AI currently supports Single-speaker mode only)
  2. Click Talk With AI.
  3. In the new window:
  4. Start Conversation: Begins the session. Speak into your microphone.
  5. Stop Conversation: Ends the session.
  6. Grounding with Google Search: Check this box to allow Gemini to search the web for answers (e.g., current news, weather).
  7. Thinking level: Choose No Thinking, Low, Medium, or High.
  8. Microphone Toggle: Mute/Unmute your microphone.
  9. Volume: Adjust the AI's playback volume.

Advanced Settings


Buttons Overview


Input Gestures

Customizable via: NVDA Menu → Preferences → Input Gestures → Native Speech Generation

Default gesture:


Development & Contribution Guide

If you want to develop or modify this add-on, follow the steps below.

Environment Setup

uv sync uv run pre-commit run --all-files uv run scons uv run scons pot

SCons 4.10.1, Markdown 3.10, Ruff 0.14.10, Pyright 1.1.407, and the other build tools are installed from uv.lock. * GNU Gettext Tools (optional, recommended for localization)

Additional Dependencies

For local development only, install the audio-only Talk With AI dependencies directly into the add-on library path using the Python version and architecture that match the NVDA runtime you are testing:

python.exe -m pip install google-genai pyaudio --target "D:/myAdd-on/Native-Speech-Generation/addon/globalPlugins/NativeSpeechGeneration/lib"

Adjust the path according to your local add-on source directory.

For the current audio-only Talk With AI implementation, you do not need opencv-python, pillow, or mss.

For release packages, the add-on downloads the latest verified dependency archive based on the running NVDA version:

The add-on reads SHA-256 data from the latest GitHub dependency release, using the release asset digest or checksum files. Bundled approved checksums are kept only as a fallback for first-time installs when the latest-release lookup fails. Manual library reinstalls require the latest verified release. The extracted folder is always installed as addon/globalPlugins/NativeSpeechGeneration/lib.

Then copy the following from your Python installation into:

addon/globalPlugins/NativeSpeechGeneration/lib


Contributing

Contributions, suggestions, and bug reports are very welcome.

Contact