mguven61 commited on
Commit
bedf11b
Β·
verified Β·
1 Parent(s): 66c0d4d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -8
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
- <p> <strong>dear users:</strong> trabzon champion.</p>
 
 
 
 
 
 
 
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