TLDR:
What I want to acquire is the source code for pyttsx3.Engine.proxy._driver.say
, in order to modify its source code to save the converted audio file instead of speaking it, but unfortunately, this was it. Is there any way to acquire these kinds of internal source codes in VS code or in any other IDEs if applicable?
I've been struggling trying to make an audiobook in Python that can be played and paused based on the user's preference. The gTTS module allows text to audio conversion but requires internet connection, so it gives users more burden. The pyttsx3.say() method from the pyttsx3 module allows text to be directly spoken by a device, but it does not give users the option of pause and play. the pyttsx3.save_to_file() method does save text to audio, but it's very buggy when saving a large text file. Hence, I tried to look at the internal source code for the pyttsx3.say() but the farthest I could see was:
engine.py
def say(self, text, name=None):
"""
Adds an utterance to speak to the event queue.
@param text: Text to sepak
@type text: unicode
@param name: Name to associate with this utterance. Included in
notifications about this utterance.
@type name: str
"""
self.proxy.say(text, name)
driver.py
def say(self, text, name):
'''
Called by the engine to push a say command onto the queue.
@param text: Text to speak
@type text: unicode
@param name: Name to associate with the utterance
@type name: str
'''
self._push(self._driver.say, (text,), name)
What I want to acquire is the source code for pyttsx3.Engine.proxy._driver.say
, in order to modify its source code to save the converted audio file instead of speaking it, but unfortunately, this was it. Is there any way to acquire these kinds of internal source codes in VS code or in any other IDEs if applicable?