nateshmbhat / pyttsx3

Offline Text To Speech synthesis for python
Mozilla Public License 2.0
1.99k stars 321 forks source link

engine.say has no sound after not using window about 1 hour #273

Open enxuan opened 1 year ago

enxuan commented 1 year ago

I have code to say tts: import pyttsx3 engine = pyttsx3.init() engine.setProperty('rate', rate) engine.setProperty('volume', volume) engine.say('I will speak this text') engine.runAndWait() This code work ok if my PC is using or other PC remote to my PC. But if my PC is not using about 1 hour (no touch, no any event), if I run jenkins build from jenkins PC (not my PC), it has no sound at all. I am using window 10, already set never sleep, fixed speaker for speech to text setting. lib version: 2.90

Jiangshan00001 commented 1 year ago

"But if my PC is not using about 1 hour (no touch, no any event), if I run jenkins build from jenkins PC (not my PC), it has no sound at all." the code is executed in my PC? the code is executed using which mode? ssh? vnc? remote desktop? or locally?

enxuan commented 1 year ago

"But if my PC is not using about 1 hour (no touch, no any event), if I run jenkins build from jenkins PC (not my PC), it has no sound at all." ==> it means that we do not touch to "my PC" and the source code is auto get to "my PC" and run on it. the code is executed in my PC? --> yes, it is, the code is auto sync by jenkins and run on my PC the code is executed using which mode? ssh? vnc? remote desktop? or locally? --> the code is run on my PC so it run locally. If when code is running, I use other PC to remote to "my PC", I can hear engine.say speak normally. If I close the remote, "my PC" will has no sound at all. If when code is running, I log in to "my PC" and has event, the sound play normally again.

Jiangshan00001 commented 1 year ago

1 my PC, which runs the code 2 jenkins PC, which trigger the program run? how the jenkins PC tell my PC to run the code when jenkins want to?

i think this maybe the same problem with this one: https://github.com/nateshmbhat/pyttsx3/issues/263

enxuan commented 1 year ago

yes, I think I have same issue with https://github.com/nateshmbhat/pyttsx3/issues/263 The issue seem due to engine.say() has no sound when PC screen is locked. You can try to reproduce it by run you code, after run press window+L to off the screen and check if you can hear the sound or not.