Update app.py
Browse files
app.py
CHANGED
@@ -51,26 +51,35 @@ Demo for cascaded speech-to-speech translation (STST), mapping from source speec
|
|
51 |

|
52 |
"""
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
)
|
72 |
-
|
73 |
-
with
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
demo.launch()
|
|
|
51 |

|
52 |
"""
|
53 |
|
54 |
+
# mic_translate = gr.Interface(
|
55 |
+
# fn=speech_to_speech_translation,
|
56 |
+
# inputs=gr.Audio(source="microphone", type="filepath"),
|
57 |
+
# outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
58 |
+
# title=title,
|
59 |
+
# description=description,
|
60 |
+
# )
|
61 |
+
|
62 |
+
# file_translate = gr.Interface(
|
63 |
+
# fn=speech_to_speech_translation,
|
64 |
+
# inputs=gr.Audio(source="upload", type="filepath"),
|
65 |
+
# outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
66 |
+
# examples=[["./example.wav"]],
|
67 |
+
# title=title,
|
68 |
+
# description=description,
|
69 |
+
# )
|
70 |
+
|
71 |
+
with gr.Blocks() as demo:
|
72 |
+
|
73 |
+
with gr.Row():
|
74 |
+
audio_in = gr.Microphone(label="Input audio", type="filepath")
|
75 |
+
audio_out = gr.Audio(label="Output audio", type="numpy", autoplay=True)
|
76 |
+
|
77 |
+
audio_in.stop_recording(
|
78 |
+
speech_to_speech_translation,
|
79 |
+
inputs=[audio_in],
|
80 |
+
outputs=[audio_out],
|
81 |
+
)
|
82 |
+
|
83 |
+
# gr.TabbedInterface([mic_translate, file_translate], ["Microphone", "Audio File"])
|
84 |
|
85 |
demo.launch()
|