File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8383#EE_BUFFER_FULL=1
8484#EE_NOT_FOUND=2
8585
86+ #eSpeak initialization flags
87+ espeakINITIALIZE_DONT_EXIT = 0x8000
88+
8689class espeak_EVENT_id (Union ):
8790 _fields_ = [
8891 ('number' ,c_int ),
@@ -329,9 +332,13 @@ def initialize(indexCallback=None):
329332 espeakDLL .espeak_GetCurrentVoice .restype = POINTER (espeak_VOICE )
330333 espeakDLL .espeak_SetVoiceByName .argtypes = (c_char_p ,)
331334 eSpeakPath = os .path .abspath ("synthDrivers" )
332- sampleRate = espeakDLL .espeak_Initialize (AUDIO_OUTPUT_SYNCHRONOUS ,300 ,
333- os .fsencode (eSpeakPath ),0 )
334- if sampleRate < 0 :
335+ sampleRate = espeakDLL .espeak_Initialize (
336+ AUDIO_OUTPUT_SYNCHRONOUS ,300 ,
337+ os .fsencode (eSpeakPath ),
338+ # #10607: ensure espeak does not exit NVDA's process on errors such as the espeak path being invalid.
339+ espeakINITIALIZE_DONT_EXIT
340+ )
341+ if sampleRate <= 0 :
335342 raise OSError ("espeak_Initialize %d" % sampleRate )
336343 player = nvwave .WavePlayer (channels = 1 , samplesPerSec = sampleRate , bitsPerSample = 16 ,
337344 outputDevice = config .conf ["speech" ]["outputDevice" ],
You can’t perform that action at this time.
0 commit comments