I'm a novice python user so I apologize if my questions are simplistic or stupid. I've tried Google searching before posting, I promise.
I have a very large document (roughly 1100 pages) that I need a speech to text MP3 of. All of the TTS modules I've seen (GTTS, etc) want strings, not documents. Here are my core questions:
Can this be done in one go? Do I have to break up the document into smaller chunks?
Is Python the correct tool for the job?
In the case of the code below, is there a way to replace the
Myfile = string
with something likeMyfile = open(mydoc.txt)
?
(Yes I just copy-pasted this from the web, but I promise I've been playing with it on my own.)
# to speech conversion
from gtts import gTTS
# This module is imported so that we can
# play the converted audio
import os
# The text that you want to convert to audio
mytext = 'Welcome to geeksforgeeks!'
# Language in which you want to convert
language = 'en'
# Passing the text and language to the engine,
# here we have marked slow=False. Which tells
# the module that the converted audio should
# have a high speed
myobj = gTTS(text=mytext, lang=language, slow=False)
# Saving the converted audio in a mp3 file named
# welcome
myobj.save("welcome.mp3")