Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def reset_usage():
|
|
35 |
}
|
36 |
return jsonify({"success": "Usage reset."}), 200
|
37 |
|
38 |
-
def text_to_speech(text):
|
39 |
global usage_data
|
40 |
current_time = datetime.now()
|
41 |
|
@@ -66,7 +66,7 @@ def text_to_speech(text):
|
|
66 |
"voice_settings": {
|
67 |
"stability": 0.5,
|
68 |
"similarity_boost": 0.8,
|
69 |
-
"style":
|
70 |
"use_speaker_boost": True
|
71 |
}
|
72 |
}
|
@@ -91,10 +91,10 @@ def text_to_speech(text):
|
|
91 |
# Crear una interfaz de Gradio para la entrada de texto y la generación de audio
|
92 |
iface = gr.Interface(
|
93 |
fn=text_to_speech,
|
94 |
-
inputs="
|
95 |
outputs="audio",
|
96 |
-
title="",
|
97 |
-
description="texto"
|
98 |
)
|
99 |
|
100 |
# Ejecutar la interfaz
|
|
|
35 |
}
|
36 |
return jsonify({"success": "Usage reset."}), 200
|
37 |
|
38 |
+
def text_to_speech(text, style):
|
39 |
global usage_data
|
40 |
current_time = datetime.now()
|
41 |
|
|
|
66 |
"voice_settings": {
|
67 |
"stability": 0.5,
|
68 |
"similarity_boost": 0.8,
|
69 |
+
"style": style, # Usar el valor de estilo proporcionado por el usuario
|
70 |
"use_speaker_boost": True
|
71 |
}
|
72 |
}
|
|
|
91 |
# Crear una interfaz de Gradio para la entrada de texto y la generación de audio
|
92 |
iface = gr.Interface(
|
93 |
fn=text_to_speech,
|
94 |
+
inputs=[gr.Textbox(label="Texto"), gr.Slider(minimum=0, maximum=1, step=0.1, label="Style")], # Añadir barra para style
|
95 |
outputs="audio",
|
96 |
+
title="Text to Speech con Ajuste de Estilo",
|
97 |
+
description="Genera audio a partir de texto con ajuste de estilo."
|
98 |
)
|
99 |
|
100 |
# Ejecutar la interfaz
|