Update app.py
Browse files
app.py
CHANGED
@@ -96,6 +96,16 @@ languages = {
|
|
96 |
demo = gr.Interface(
|
97 |
fn=translate_audio,
|
98 |
inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
gr.Audio(
|
100 |
sources=["microphone"],
|
101 |
label="π€ OR Record with Microphone",
|
@@ -113,19 +123,33 @@ demo = gr.Interface(
|
|
113 |
)
|
114 |
],
|
115 |
outputs=[
|
116 |
-
gr.Audio(label=" Translated Audio Output"),
|
117 |
-
gr.Textbox(label="Original Text"),
|
118 |
-
gr.Textbox(label=" Translated Text"),
|
119 |
-
gr.Textbox(label=" Audio Source Info")
|
120 |
],
|
121 |
|
122 |
-
title="VoiceAI61",
|
123 |
-
description=" Upload an audio file OR record with microphone to translate between languages!",
|
124 |
article="""
|
125 |
<div style="text-align: center; margin-top: 20px;">
|
126 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
</div>
|
128 |
-
""",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
allow_flagging="never"
|
130 |
)
|
131 |
|
|
|
96 |
demo = gr.Interface(
|
97 |
fn=translate_audio,
|
98 |
inputs=[
|
99 |
+
gr.Textbox(
|
100 |
+
label="π¬ Enter text to translate (optional - will use audio if provided)",
|
101 |
+
placeholder="Type text here or leave empty to use audio input...",
|
102 |
+
lines=2
|
103 |
+
),
|
104 |
+
gr.Audio(
|
105 |
+
type="filepath",
|
106 |
+
sources=["upload"],
|
107 |
+
label="π Upload Audio File (MP3, WAV, etc.)"
|
108 |
+
),
|
109 |
gr.Audio(
|
110 |
sources=["microphone"],
|
111 |
label="π€ OR Record with Microphone",
|
|
|
123 |
)
|
124 |
],
|
125 |
outputs=[
|
126 |
+
gr.Audio(label="π Translated Audio Output"),
|
127 |
+
gr.Textbox(label="π Original Text"),
|
128 |
+
gr.Textbox(label="π Translated Text"),
|
129 |
+
gr.Textbox(label="βΉοΈ Audio Source Info")
|
130 |
],
|
131 |
|
132 |
+
title="π€ VoiceAI61 - Universal Voice Translator",
|
133 |
+
description="π Upload an audio file OR record with microphone to translate between languages!",
|
134 |
article="""
|
135 |
<div style="text-align: center; margin-top: 20px;">
|
136 |
+
<h3>π― How to Use:</h3>
|
137 |
+
<p><strong>Option 1:</strong> π Upload an audio file (recommended)</p>
|
138 |
+
<p><strong>Option 2:</strong> π€ Record directly with microphone</p>
|
139 |
+
<p><strong>Option 3:</strong> π¬ Type text directly</p>
|
140 |
+
<p><strong>Then:</strong> Select source and target languages, wait for processing!</p>
|
141 |
+
<br>
|
142 |
+
<p>π§ <strong>Troubleshooting:</strong> If microphone doesn't work, use file upload instead.</p>
|
143 |
+
<p>π± <strong>Mobile users:</strong> File upload works better on mobile devices.</p>
|
144 |
</div>
|
145 |
+
""",
|
146 |
+
|
147 |
+
examples=[
|
148 |
+
["", None, None, "tr", "en"],
|
149 |
+
["", None, None, "en", "fr"],
|
150 |
+
["Hello world", None, None, "en", "es"],
|
151 |
+
],
|
152 |
+
|
153 |
allow_flagging="never"
|
154 |
)
|
155 |
|