Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
@@ -189,21 +189,22 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"
|
|
189 |
with gr.Tabs():
|
190 |
with gr.TabItem("Edge-TTS"):
|
191 |
gr.Markdown("É ilimitado, podendo até mesmo colocar um livro inteiro, mas claro, tem a questão de tempo, quanto maior o texto, mais demorado é, dublagem por SRT talvez um dia eu bote.")
|
192 |
-
|
193 |
-
# Language selection dropdown
|
194 |
-
language_input = gr.Dropdown(
|
195 |
-
choices=available_languages,
|
196 |
-
label="Idioma",
|
197 |
-
value=available_languages[52] if available_languages else None
|
198 |
-
)
|
199 |
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
|
208 |
# Connect language selection to voice model update
|
209 |
language_input.change(
|
@@ -243,21 +244,22 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"
|
|
243 |
checkbox_cortar_silencio = gr.Checkbox(label="Cortar Silencio", interactive=True)
|
244 |
audio_output = gr.Audio(label="Resultado", type="filepath", interactive=False)
|
245 |
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
|
|
261 |
|
262 |
# Add update voices button at the top
|
263 |
update_voices_btn = gr.Button(value="Atualizar Lista de Vozes")
|
@@ -272,18 +274,19 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"
|
|
272 |
with gr.TabItem("Lote (Arquivo txt)"):
|
273 |
gr.Markdown("Carregar texto de um arquivo")
|
274 |
# Language and voice selection (same as first tab)
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
|
|
287 |
|
288 |
language_input_file.change(
|
289 |
fn=update_voice_options,
|
@@ -326,22 +329,22 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"
|
|
326 |
|
327 |
checkbox_cortar_silencio_file = gr.Checkbox(label="Cortar Silencio", interactive=True)
|
328 |
audio_output_file = gr.Audio(label="Resultado", type="filepath", interactive=False)
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
|
346 |
gr.Markdown("Agradecimentos a rany2 pelo Edge-TTS")
|
347 |
|
|
|
189 |
with gr.Tabs():
|
190 |
with gr.TabItem("Edge-TTS"):
|
191 |
gr.Markdown("É ilimitado, podendo até mesmo colocar um livro inteiro, mas claro, tem a questão de tempo, quanto maior o texto, mais demorado é, dublagem por SRT talvez um dia eu bote.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
|
193 |
+
with gr.Row():
|
194 |
+
# Language selection dropdown
|
195 |
+
language_input = gr.Dropdown(
|
196 |
+
choices=available_languages,
|
197 |
+
label="Idioma",
|
198 |
+
value=available_languages[52] if available_languages else None
|
199 |
+
)
|
200 |
+
|
201 |
+
# Voice model dropdown (will be updated based on language selection)
|
202 |
+
initial_voices = get_voice_options(available_languages[52], voices_data) if available_languages else []
|
203 |
+
voice_model_input = gr.Dropdown(
|
204 |
+
choices=initial_voices,
|
205 |
+
label="Modelo de Voz",
|
206 |
+
value=initial_voices[0] if initial_voices else None
|
207 |
+
)
|
208 |
|
209 |
# Connect language selection to voice model update
|
210 |
language_input.change(
|
|
|
244 |
checkbox_cortar_silencio = gr.Checkbox(label="Cortar Silencio", interactive=True)
|
245 |
audio_output = gr.Audio(label="Resultado", type="filepath", interactive=False)
|
246 |
|
247 |
+
with gr.Row():
|
248 |
+
edgetts_button = gr.Button(value="Falar")
|
249 |
+
edgetts_button.click(
|
250 |
+
controlador_generate_audio,
|
251 |
+
inputs=[
|
252 |
+
audio_input,
|
253 |
+
voice_model_input,
|
254 |
+
speed_input,
|
255 |
+
pitch_input, # New input
|
256 |
+
volume_input, # New input
|
257 |
+
checkbox_cortar_silencio
|
258 |
+
],
|
259 |
+
outputs=[audio_output]
|
260 |
+
)
|
261 |
+
|
262 |
+
clear_button = gr.ClearButton(audio_input, value='Limpar')
|
263 |
|
264 |
# Add update voices button at the top
|
265 |
update_voices_btn = gr.Button(value="Atualizar Lista de Vozes")
|
|
|
274 |
with gr.TabItem("Lote (Arquivo txt)"):
|
275 |
gr.Markdown("Carregar texto de um arquivo")
|
276 |
# Language and voice selection (same as first tab)
|
277 |
+
with gr.Row():
|
278 |
+
language_input_file = gr.Dropdown(
|
279 |
+
choices=available_languages,
|
280 |
+
label="Idioma",
|
281 |
+
value=available_languages[52] if available_languages else None
|
282 |
+
)
|
283 |
+
|
284 |
+
initial_voices = get_voice_options(available_languages[52], voices_data) if available_languages else []
|
285 |
+
voice_model_input_file = gr.Dropdown(
|
286 |
+
choices=initial_voices,
|
287 |
+
label="Modelo de Voz",
|
288 |
+
value=initial_voices[0] if initial_voices else None
|
289 |
+
)
|
290 |
|
291 |
language_input_file.change(
|
292 |
fn=update_voice_options,
|
|
|
329 |
|
330 |
checkbox_cortar_silencio_file = gr.Checkbox(label="Cortar Silencio", interactive=True)
|
331 |
audio_output_file = gr.Audio(label="Resultado", type="filepath", interactive=False)
|
332 |
+
with gr.Row():
|
333 |
+
edgetts_button_file = gr.Button(value="Falar")
|
334 |
+
edgetts_button_file.click(
|
335 |
+
controlador_generate_audio_from_file,
|
336 |
+
inputs=[
|
337 |
+
file_input,
|
338 |
+
voice_model_input_file,
|
339 |
+
speed_input_file,
|
340 |
+
pitch_input_file,
|
341 |
+
volume_input_file,
|
342 |
+
checkbox_cortar_silencio_file
|
343 |
+
],
|
344 |
+
outputs=[audio_output_file]
|
345 |
+
)
|
346 |
+
|
347 |
+
clear_button_file = gr.ClearButton(file_input, value='Limpar')
|
348 |
|
349 |
gr.Markdown("Agradecimentos a rany2 pelo Edge-TTS")
|
350 |
|