Why is textract and gtts are so slow? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why is textract and gtts are so slow?

import textract as tx from gtts import gTTS text=tx.process('/storage/emulated/0/Download/Rich Dad Poor Dad ( PDFDrive ).pdf').decode('utf-8') def convert_to_audio(text): my_audio=gTTS(text) my_audio.save('hello.mp3') convert_to_audio(text) #The code above takes too much time to execute, So how can I reduce the time?

25th Mar 2021, 12:54 AM
Ujjawal Gupta
Ujjawal Gupta - avatar
4 Answers
0
Write the libraries yourself, better than the original authors. When you use others' code, you have to deal with their drawbacks
25th Mar 2021, 7:36 AM
Slick
Slick - avatar
+ 1
A python text to speech script will usually always take a long time. Python language is slow. I got a network scanner that works, but it takes 6 minutes to get results haha. But converting a whole pdf to an audio file will take some time.
25th Mar 2021, 7:31 AM
Slick
Slick - avatar
0
Hmm ok But how can I reduce the time
25th Mar 2021, 7:33 AM
Ujjawal Gupta
Ujjawal Gupta - avatar
0
Ok
25th Mar 2021, 8:11 AM
Ujjawal Gupta
Ujjawal Gupta - avatar