No Rhyme, No Reason, Just Trial, Error and Luck
Every so often my Python code doesn't work even though it "should". I'm relying on somebody's imported module and have no idea how it works. In this case it is the PYTTSX3 module. In theory, if you follow the instructions, it will accept a text string and output the corresponding audio in a male voice or a female voice. (TTS means Text To Speech). I got it to work. But only ONCE. When called the second time ... silence. Apparently I'm not the first to experience this puzzling behavior. Look it up in Reddit, look it up in Google and you see that others also ask, "How do I get PYTTSX3 to play more than once?" Google's AI (Gemini) offers some suggestions but none of them work. Out of frustration, I try all kinds of permutations including re-initializing the talk engine, time delays, whatever. Out of dumb luck I stumble upon a variation that suddenly makes my old Windows 10 computer perform. Why does this variation work? No idea. ( Click on ...