Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,14 +14,18 @@ def synthesize_speech(text, speaker_id):
|
|
14 |
sf.write("speech.wav", speech["audio"], samplerate=speech["sampling_rate"])
|
15 |
return "speech.wav"
|
16 |
|
17 |
-
#
|
18 |
iface = gr.Interface(
|
19 |
fn=synthesize_speech,
|
20 |
-
inputs=[
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
24 |
)
|
25 |
|
26 |
-
# Launch the app
|
27 |
iface.launch()
|
|
|
14 |
sf.write("speech.wav", speech["audio"], samplerate=speech["sampling_rate"])
|
15 |
return "speech.wav"
|
16 |
|
17 |
+
# Improved Interface
|
18 |
iface = gr.Interface(
|
19 |
fn=synthesize_speech,
|
20 |
+
inputs=[
|
21 |
+
gr.Textbox(label="Enter Text", placeholder="Type here to practice English pronunciation..."),
|
22 |
+
gr.Slider(minimum=0, maximum=len(embeddings_dataset)-1, label="Select Speaker Voice")
|
23 |
+
],
|
24 |
+
outputs=gr.Audio(label="Pronunciation Audio"),
|
25 |
+
title="English Pronunciation Helper",
|
26 |
+
description="This tool helps you practice English pronunciation. Type any text in English, and hear how it's pronounced.",
|
27 |
+
theme="huggingface", # You can choose different themes
|
28 |
+
layout="vertical" # For a top-down layout
|
29 |
)
|
30 |
|
|
|
31 |
iface.launch()
|