need help with using speech in threads in python

Hi,
In the Talking Flight Monitor software I'm writing, I want to be able to use threads to speed up the system.
Unfortunately, it looks like the accessible_output_2 module doesn't support threading. Whenever I try to output anything using speech in the secondary thread,, I get a traceback like the following. This traceback was when I was testing with pypubsub, but it happens if I use the speech call directly in the second thread as well.
Any ideas?


Exception in thread Thread-1:                                                                                                                                                                                                               
Traceback (most recent call last):                                                                                                                                                                                                           
  File "C:\python37\lib\site-packages\accessible_output2\outputs\http://sapi5.py", line 37, in __init__                                                                                                                                             
    self.object = load_com("SAPI.SPVoice")                                                                                                                                                                                                   
  File "C:\python37\lib\site-packages\libloader-0.21-py3.7.egg\libloader\http://com.py", line 21, in load_com                                                                                                                                       
    raise com_error("Unable to load any of the provided com objects.")                                                                                                                                                                       
http://pywintypes.com: Unable to load any of the provided com objects.                                                                                                                                                                       
blank
During handling of the above exception, another exception occurred:                                                                                                                                                                         
blank
Traceback (most recent call last):                                                                                                                                                                                                           
  File "C:\python37\lib\http://threading.py", line 917, in _bootstrap_inner                                                                                                                                                                         
    http://self.run()                                                                                                                                                                                                                               
  File "C:\Users\jfayr\projects\talking-flight-monitor\http://flightsim.py", line 176, in run                                                                                                                                                       
    http://self.read()                                                                                                                                                                                                                       
  File "C:\Users\jfayr\projects\talking-flight-monitor\http://flightsim.py", line 355, in read_config                                                                                                                                               
    pub.sendMessage("speak", arg1="test message")                                                                                                                                                                                           
  File "C:\python37\lib\site-packages\pubsub\core\http://publisher.py", line 216, in sendMessage                                                                                                                                                   
    topicObj.publish(**msgData)                                                                                                                                                                                                             
  File "C:\python37\lib\site-packages\pubsub\core\http://topicobj.py", line 452, in publish                                                                                                                                                         
    self.__sendMessage(msgData, topicObj, msgDataSubset)                                                                                                                                                                                     
  File "C:\python37\lib\site-packages\pubsub\core\http://topicobj.py", line 482, in __sendMessage                                                                                                                                                   
    listener(data, self, allData)                                                                                                                                                                                                           
  File "C:\python37\lib\site-packages\pubsub\core\http://listener.py", line 237, in __call__                                                                                                                                                       
    cb(**kwargs)                                                                                                                                                                                                                             
  File "http://tfm.py", line 101, in speak                                                                                                                                                                                                         
    output = sapi5.SAPI5()                                                                                                                                                                                                                   
  File "C:\python37\lib\site-packages\accessible_output2\outputs\http://sapi5.py", line 40, in __init__                                                                                                                                             
    raise OutputError                                                                                                                                                                                                                       
accessible_output2.outputs.base.OutputError

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : jfayre via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : jfayre via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector

Reply via email to