Skip to content

Instantly share code, notes, and snippets.

@salma71
Created January 21, 2021 23:26
Show Gist options
  • Save salma71/60569db5aaceaf74f8e84f301a43201c to your computer and use it in GitHub Desktop.
Save salma71/60569db5aaceaf74f8e84f301a43201c to your computer and use it in GitHub Desktop.
from gtts import gTTS
from pdfminer.high_level import extract_text
def pdf_to_text(file_obj):
text = extract_text(file_obj.name)
myobj = gTTS(text=text, lang='en', slow=False)
myobj.save("test.wav")
return 'test.wav'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment