Spaces:
Runtime error
Runtime error
Delete app.py
Browse files
app.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
from gtts import gTTS
|
| 2 |
-
import gradio as gr
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
def textToSpeech(text,lang,file):
|
| 6 |
-
|
| 7 |
-
if file is not None:
|
| 8 |
-
with open(file.name, "r", encoding="utf-8") as f:
|
| 9 |
-
text = f.read()
|
| 10 |
-
|
| 11 |
-
record=gTTS(text=text,lang=lang,slow=False)
|
| 12 |
-
record.save("output.mp3")
|
| 13 |
-
return "output.mp3"
|
| 14 |
-
|
| 15 |
-
interface=gr.Interface(
|
| 16 |
-
fn=textToSpeech,
|
| 17 |
-
inputs=[gr.Textbox(label='Text to be spoken'),
|
| 18 |
-
gr.Dropdown(
|
| 19 |
-
["tr", "en", "fr", "de"],
|
| 20 |
-
label="Language Selection",
|
| 21 |
-
value="tr"),
|
| 22 |
-
gr.File(label="Upload Text File(Optional)",type="filepath")
|
| 23 |
-
],
|
| 24 |
-
outputs=gr.Audio(label="Voice"),
|
| 25 |
-
title="Text To Speech",
|
| 26 |
-
description="Enter the text you want to voice into the box"
|
| 27 |
-
|
| 28 |
-
)
|
| 29 |
-
|
| 30 |
-
interface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|