Update app.py
Browse files
app.py
CHANGED
@@ -27,48 +27,15 @@ all_voices = voices()
|
|
27 |
desired_voices = ["Antonio"]
|
28 |
filtered_voices = [voice.name for voice in all_voices if voice.name in desired_voices]
|
29 |
|
30 |
-
input_text = gr.Textbox(
|
31 |
-
|
32 |
-
|
33 |
-
value="Diamo voce alle tue parole, scrivi qui ciò che vuoi ascoltare!",
|
34 |
-
elem_id="input_text"
|
35 |
-
)
|
36 |
-
|
37 |
-
input_voice = gr.Dropdown(
|
38 |
-
choices=filtered_voices,
|
39 |
-
default="Antonio",
|
40 |
-
label="Voice",
|
41 |
-
elem_id="input_voice"
|
42 |
-
)
|
43 |
-
|
44 |
-
out_audio = gr.Audio(
|
45 |
-
label="Generated Voice",
|
46 |
-
type="numpy",
|
47 |
-
elem_id="out_audio"
|
48 |
-
)
|
49 |
-
|
50 |
-
css = """
|
51 |
-
.gr-textbox {
|
52 |
-
font-size: 12px;
|
53 |
-
}
|
54 |
-
.gr-dropdown {
|
55 |
-
font-size: 12px;
|
56 |
-
}
|
57 |
-
.gr-audio {
|
58 |
-
width: 90%;
|
59 |
-
}
|
60 |
-
"""
|
61 |
|
62 |
iface = gr.Interface(
|
63 |
fn=generate_voice,
|
64 |
inputs=[input_text, input_voice],
|
65 |
outputs=out_audio,
|
66 |
-
live=True
|
67 |
-
theme="Monochrome",
|
68 |
-
concurrency_count=1,
|
69 |
-
css=css,
|
70 |
-
width=320,
|
71 |
-
height=480
|
72 |
)
|
73 |
|
74 |
iface.launch()
|
|
|
27 |
desired_voices = ["Antonio"]
|
28 |
filtered_voices = [voice.name for voice in all_voices if voice.name in desired_voices]
|
29 |
|
30 |
+
input_text = gr.Textbox(label="Input Text", lines=2)
|
31 |
+
input_voice = gr.Dropdown(choices=filtered_voices, default="Antonio", label="Voice")
|
32 |
+
out_audio = gr.Audio(label="Generated Voice", type="numpy")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
iface = gr.Interface(
|
35 |
fn=generate_voice,
|
36 |
inputs=[input_text, input_voice],
|
37 |
outputs=out_audio,
|
38 |
+
live=True
|
|
|
|
|
|
|
|
|
|
|
39 |
)
|
40 |
|
41 |
iface.launch()
|