Tyler Spivey

342 Followers
46 Following
844 Posts
Interested in technology, older access technology and speech synthesizers

@cachondo @NVAccess @ppatel Put this in scratchpad\globalPlugins. If it breaks, you get to keep both pieces. I've tested it with the play key on my keyboard and NVDA 2026.1 beta 8. It should work going back to 2025.
from globalPluginHandler import GlobalPlugin
import inputCore
from scriptHandler import script
import queueHandler
import speech
from speech import sayAll
import tones

VK_MEDIA_PLAY_PAUSE = 0xB3

class GlobalPlugin(GlobalPlugin):
def __init__(self):
super().__init__()
self.patched = False

# We're dealing with low-level keyboard processing, so patch on the first press of play/pause.
# In case this breaks, I still need a keyboard.
@script(gesture="kb:mediaPlayPause", description="Patch")
def script_patch(self, gesture):
if not self.patched:
self.patch()
tones.beep(2000, 50)

def patch(self):
inputCore.decide_handleRawKey.register(self.handle)
self.patched = True

def terminate(self):
if self.patched:
inputCore.decide_handleRawKey.unregister(self.handle)
self.patched = False

def handle(self, vkCode=None, pressed=None, **kwargs):
if vkCode != VK_MEDIA_PLAY_PAUSE or not pressed:
return True
if not sayAll.SayAllHandler.isRunning():
sayAll.SayAllHandler.readText(sayAll.CURSOR.CARET, startedFromScript=True)
return False
if speech.getState().isPaused:
queueHandler.queueFunction(queueHandler.eventQueue, speech.pauseSpeech, False)
return False
else:
queueHandler.queueFunction(queueHandler.eventQueue, speech.pauseSpeech, True)
return False

@lorry Thanks, that works perfectly. You might want to put something on connect about how to log in, but an OCR of the web terminal got me the command I needed.
@lorry Still unusable. It's just an image on top of a canvas, so the screen reader can't get anything out of it.
@lorry I'm interested, but unfortunately can't access the web terminal with my screen reader. Would you please consider putting a telnet connection up somewhere?
@Tamasg @jackf723 Nothing seems to have changed there.
@Tamasg Rate 60, pitch mode impulse, US English, read the words found out, or thousand.
@Tamasg You can take espeak out of your processing chain and then do whatever you want. Every other synth has its own word to phoneme rules. I can't think of another one that doesn't. It might be difficult if you want to support all those languages, but it should give you a more flexible system in the end.
@ppatel Go ahead. I don't have a problem with that.
@muchanchoasado It sounds like you have a corrupted Windows installation. Was your computer always like that, or did you install some kind of stripped-down version of Windows? There are repair options you can try, specifically this Microsoft Support article: https://support.microsoft.com/en-us/topic/use-the-system-file-checker-tool-to-repair-missing-or-corrupted-system-files-79aa86cb-ca52-166a-92a3-966e85d4094e
Use the System File Checker tool to repair missing or corrupted system files - Microsoft Support

Describes how to use the System File Checker tool to troubleshoot missing or corrupted system files in Windows.

@muchanchoasado c:\windows\system32\speech\speechux\sapi.cpl might be what you want. Also, you can try installing the OneCore voices in settings. On Windows 11, look in Settings, Time & language, Speech.