Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ usage_data = {
|
|
| 22 |
MESSAGE_LIMIT = 145
|
| 23 |
TIME_LIMIT = timedelta(hours=2)
|
| 24 |
|
| 25 |
-
def text_to_speech(text, style):
|
| 26 |
global usage_data
|
| 27 |
current_time = datetime.now()
|
| 28 |
|
|
@@ -54,6 +54,7 @@ def text_to_speech(text, style):
|
|
| 54 |
"stability": 0.5,
|
| 55 |
"similarity_boost": 0.8,
|
| 56 |
"style": style,
|
|
|
|
| 57 |
"use_speaker_boost": True
|
| 58 |
}
|
| 59 |
}
|
|
@@ -76,7 +77,8 @@ iface = gr.Interface(
|
|
| 76 |
fn=text_to_speech,
|
| 77 |
inputs=[
|
| 78 |
gr.Textbox(label="Texto"),
|
| 79 |
-
gr.Slider(minimum=0, maximum=1, step=0.1, label="Style")
|
|
|
|
| 80 |
],
|
| 81 |
outputs=gr.Audio(type="filepath"),
|
| 82 |
title="",
|
|
|
|
| 22 |
MESSAGE_LIMIT = 145
|
| 23 |
TIME_LIMIT = timedelta(hours=2)
|
| 24 |
|
| 25 |
+
def text_to_speech(text, style, speed):
|
| 26 |
global usage_data
|
| 27 |
current_time = datetime.now()
|
| 28 |
|
|
|
|
| 54 |
"stability": 0.5,
|
| 55 |
"similarity_boost": 0.8,
|
| 56 |
"style": style,
|
| 57 |
+
"speed": speed, # <= Nuevo parámetro de velocidad
|
| 58 |
"use_speaker_boost": True
|
| 59 |
}
|
| 60 |
}
|
|
|
|
| 77 |
fn=text_to_speech,
|
| 78 |
inputs=[
|
| 79 |
gr.Textbox(label="Texto"),
|
| 80 |
+
gr.Slider(minimum=0, maximum=1, step=0.1, label="Style", value=0.5),
|
| 81 |
+
gr.Slider(minimum=0.7, maximum=1.2, step=0.01, label="Velocidad", value=1)
|
| 82 |
],
|
| 83 |
outputs=gr.Audio(type="filepath"),
|
| 84 |
title="",
|