Skip to content

Instantly share code, notes, and snippets.

@jcsteh
Created December 21, 2025 12:58
Show Gist options
  • Select an option

  • Save jcsteh/e92a15fc820d4b346a9097c0368fa9f8 to your computer and use it in GitHub Desktop.

Select an option

Save jcsteh/e92a15fc820d4b346a9097c0368fa9f8 to your computer and use it in GitHub Desktop.
A very hacky NVDA global plugin to make nvdaController_speakText interrupt speech and queue it for immediate execution for the fastest possible responsiveness.
from ctypes import WINFUNCTYPE, c_long, c_wchar_p
from globalPluginHandler import GlobalPlugin
import NVDAHelper
import queueHandler
import speech
@WINFUNCTYPE(c_long, c_wchar_p)
def nvdaController_speakText(text):
speech.cancelSpeech()
queueHandler.queueFunction(queueHandler.eventQueue, speech.speakText, text, _immediate=True)
return 0
NVDAHelper.nvdaController_speakText_patched = nvdaController_speakText
NVDAHelper._setDllFuncPointer(NVDAHelper.localLib.dll, "_nvdaController_speakText", NVDAHelper.nvdaController_speakText_patched)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment