Last active
January 22, 2021 20:39
-
-
Save salma71/5346c7465caef878464dec6a404a28cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gtts import gTTS | |
from pdfminer.high_level import extract_text | |
import gradio as gr | |
def pdf_to_text(file_obj): | |
text = extract_text(file_obj.name) | |
myobj = gTTS(text=text, lang='en', slow=False) | |
myobj.save("output.wav") | |
return 'output.wav' | |
iface = gr.Interface( | |
fn = pdf_to_text, | |
inputs = 'file', | |
outputs = 'audio' | |
) | |
iface.launch() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment