nateshmbhat / pyttsx3

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

pyttsx3 generates hundreds of logging messages, even when debug is False #195

Open AndyW118 opened 3 years ago

AndyW118 commented 3 years ago

The package generates 61 DEBUG logging entries when the engine is init'd and 223 entries each time say() is called. The latter are all of the form

unimplemented method _ISpeechVoiceEvents_Word called <comtypes.client._events.CreateEventReceiver..Sink object at 0x000001FD82E8FB50>.Release() -> 1 <comtypes.client._events.CreateEventReceiver..Sink object at 0x000001FD82E8FB50>.AddRef() -> 2 unimplemented method _ISpeechVoiceEvents_Phoneme called <comtypes.client._events.CreateEventReceiver..Sink object at 0x000001FD82E8FB50>.Release() -> 1 <comtypes.client._events.CreateEventReceiver..Sink object at 0x000001FD82E8FB50>.AddRef() -> 2 unimplemented method _ISpeechVoiceEvents_Viseme called <comtypes.client._events.CreateEventReceiver..Sink object at 0x000001FD82E8FB50>.Release() -> 1 <comtypes.client._events.CreateEventReceiver..Sink object at 0x000001FD82E8FB50>.AddRef() -> 2 unimplemented method _ISpeechVoiceEvents_Phoneme called <comtypes.client._events.CreateEventReceiver..Sink object at 0x000001FD82E8FB50>.Release() -> 1 <comtypes.client._events.CreateEventReceiver..Sink object at 0x000001FD82E8FB50>.AddRef() -> 2

The speech reproduction is nevertheless perfect! I can't use the package if it generates all these messages.

oweppe commented 3 years ago

Changing the level specifically for the "comtypes" logger seems to solve the issue: logging.getLogger("comtypes").setLevel(logging.WARNING)

AndyW118 commented 3 years ago

Thanks for that. But I'm not clear whether that's something I should do, or something the pyttsx3 developers will be doing. Could you claify that please.

willwade commented 1 month ago

Yeah. I think I'll change this too or add a debug flag or something.