You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a flask web which using the pyttsx3. the server's OS is win server 2019, it is a vmware virtualmachine. The virtualmachine does not have an audio card.
When I using RDP(mstsc) to connect the server, server 2019 will create a audio output device by “Remote audio playback”. I login the web by myself computer, and create a tts job. The program writing a wav file is OK.
But, when I disconnect the server, I create a tts job, the program writing a empty wav file. And the pyttsx3's debug info display:
Traceback (most recent call last):
File "C:\Users\XXXXXX\AppData\Roaming\Python\Python39\site-packages\pyttsx3\driver.py", line 90, in _pump
cmd[0](*cmd[1])
File "C:\Users\XXXXXX\AppData\Roaming\Python\Python39\site-packages\pyttsx3\drivers\sapi5.py", line 69, in save_to_file
temp_stream = self._tts.AudioOutputStream
_ctypes.COMError: (-2147200966, None, (None, None, None, 0, None))
The reason for this situation is, win server 2019 dose not have an audio output device, SpVoice AudioOutputStream Object will raise an exception.
My suggestion, change the source code pyttsx3\drivers\sapi5.py 'save_to_file'. add a 'try except' like this:
I'm writing a flask web which using the pyttsx3. the server's OS is win server 2019, it is a vmware virtualmachine. The virtualmachine does not have an audio card.
When I using RDP(mstsc) to connect the server, server 2019 will create a audio output device by “Remote audio playback”. I login the web by myself computer, and create a tts job. The program writing a wav file is OK.
But, when I disconnect the server, I create a tts job, the program writing a empty wav file. And the pyttsx3's debug info display:
The reason for this situation is, win server 2019 dose not have an audio output device, SpVoice AudioOutputStream Object will raise an exception.
My suggestion, change the source code pyttsx3\drivers\sapi5.py 'save_to_file'. add a 'try except' like this:
The text was updated successfully, but these errors were encountered: