ERROR - external:synthDrivers.vocalizer_expressive2.BgThread.run (23:03:36.631) - Thread-11 (73120): Error running task from queue Traceback (most recent call last): File "C:\Users\NS\AppData\Roaming\nvda\addons\Vocalizer Expressive Driver\synthDrivers\vocalizer_expressive2\__init__.py", line 85, in run task() File "C:\Users\NS\AppData\Roaming\nvda\addons\Vocalizer Expressive Driver\synthDrivers\vocalizer_expressive2\__init__.py", line 141, in __call__ ve2.processText2Speech(self._instance, self._text) File "C:\Users\NS\AppData\Roaming\nvda\addons\Vocalizer Expressive Driver\synthDrivers\vocalizer_expressive2\ve2\__init__.py", line 172, in processText2Speech veDll.ve_ttsProcessText2Speech(instance, byref(inText)) File "C:\Users\NS\AppData\Roaming\nvda\addons\Vocalizer Expressive Driver\synthDrivers\vocalizer_expressive2\ve2\__init__.py", line 23, in veCheckForError raise VeError(result, "Vocalizer Error: %s: %x" % (func.__name__, result)) synthDrivers.vocalizer_expressive2.ve2.veTypes.VeError: Vocalizer Error: ve_ttsProcessText2Speech: 8000000a It sounds like you're encountering a specific issue with the Vocalizer Expressive 2 NVDA add-on when processing Arabic characters, where it pauses before speaking. This often points to how the text-to-speech engine handles character encoding or language switching. While I can't directly fix code in your local environment, I can offer some general approaches and potential areas to investigate within the add-on's Python code that might help resolve or mitigate this. Here's what you can look into: 1. Encoding of the Input Text: Problem: If the Arabic characters are not being passed to the Vocalizer engine with the correct encoding (e.g., UTF-8), it might struggle to process them, leading to delays or errors. Where to look: In the processText2Speech function within synthDrivers\vocalizer_expressive2\ve2\__init__.py (specifically around line 172 where ve_ttsProcessText2Speech is called), check how inText is being prepared. What to check: Ensure the string is explicitly encoded to utf-8 or the encoding expected by the Vocalizer SDK before being passed to the DLL. For example, you might see something like self._text.encode('utf-8'). If the Vocalizer SDK expects a different encoding (e.g., UTF-16 for wide characters), you might need to convert it accordingly. 2. Language Switching/Detection: Problem: If Vocalizer Expressive is configured for a different default language, and it encounters Arabic text, it might be taking time to detect the language and switch to an appropriate Arabic voice (if available and configured). Where to look: Check for any explicit language setting calls around the text processing. Look into NVDA's language settings for the synthesizer. What to check: Does the Vocalizer Expressive driver have options within NVDA's preferences to set a default language or enable automatic language detection? If there are functions in the veDll for setting the language, ensure they are being called correctly or consider if you can force the language to Arabic when Arabic characters are detected. 3. Batch Processing Size/Chunking: Problem: If very long strings of text are passed at once, the engine might take longer to process the entire buffer, especially with complex scripts like Arabic. Where to look: This is less likely to be the primary cause for 15-25 second delays with relatively short inputs, but it's worth considering for extremely long inputs. What to check: Is the text being sent in chunks, or is the entire text sent at once? If it's a very long string, breaking it into smaller parts might help, but this would require more significant changes to the add-on's logic. 4. Vocalizer SDK Specifics (Error Code 8000000a): Problem: The error code 8000000a (Vocalizer Error: ve_ttsProcessText2Speech: 8000000a) is crucial. This is an error code directly from the Vocalizer Expressive SDK. Without the SDK documentation, it's hard to pinpoint its exact meaning, but it generally indicates a problem within the Vocalizer engine itself when processing the text. What to check: SDK Documentation: If you have access to the Vocalizer Expressive SDK documentation (perhaps from Nuance or the developer of the add-on), look up this specific error code. It will tell you precisely what it means (e.g., "invalid parameter," "unsupported character set," "out of memory," etc.). This is often the fastest way to diagnose the problem. Character Support: Does your installed Vocalizer Expressive voice pack actually support Arabic? Some voice packs are language-specific. Ensure you have an Arabic voice installed and selected. Sample Rate/Audio Format: Though less likely for this error, ensure the audio output settings are compatible. Simplified Debugging Steps (if you're comfortable with Python): Add print statements: Temporarily add print() statements in processText2Speech to show: The _text value before encoding. The inText value after encoding (or its type and length). The result of ve_ttsProcessText2Speech. This will help you see exactly what's being sent to the DLL and what the immediate return value is. Test with a minimal Arabic string: Try passing a very short, simple Arabic string to isolate if it's the characters themselves or the length. Example of Encoding Adjustment (Illustrative - might need modification based on SDK expectations): code # In synthDrivers\vocalizer_expressive2\ve2\__init__.py, around line 172 # Original: # veDll.ve_ttsProcessText2Speech(instance, byref(inText)) # Potential modification: # Ensure self._text is a Python string (unicode in Python 2, str in Python 3) # Then, encode it to bytes in the expected format for the DLL # Let's assume the DLL expects UTF-8 encoded bytes for now. # If it expects wide characters, it would be 'utf-16-le' or 'utf-16-be' try: # Assuming self._text is the Python string with Arabic characters # Encode it to bytes using UTF-8 encoded_text = self._text.encode('utf-8') # Create a ctypes string buffer from the encoded bytes inText_buffer = create_string_buffer(encoded_text) result = veDll.ve_ttsProcessText2Speech(instance, byref(inText_buffer)) # ... then proceed with veCheckForError(result, func) except Exception as e: # Add error handling to see if encoding itself fails log.error("Error encoding text for Vocalizer: %s", e) # Re-raise or handle as appropriate Important Considerations: Backup: Always back up the original __init__.py file before making any changes. NVDA Restart: You'll need to restart NVDA after any code changes for them to take effect. Debugging Tools: If you're comfortable, you could use a Python debugger (like pdb) to step through the code and inspect variable values. Without direct access to your system or the full Vocalizer Expressive SDK documentation, it's hard to give an exact fix. However, focusing on character encoding, language settings, and understanding the 8000000a error code from the SDK is your best bet. Let me know if you can find documentation for that error code or if you try any of these suggestions!