Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -25,12 +25,11 @@ def format_prompt(message, history):
|
|
25 |
prompt += f"[INST] {message} [/INST]"
|
26 |
return prompt
|
27 |
|
28 |
-
def text_to_speech(text):
|
29 |
tts = gTTS(text=text, lang='es')
|
30 |
audio_file_path = 'output.mp3'
|
31 |
tts.save(audio_file_path)
|
32 |
|
33 |
-
# Ajustar la velocidad del audio con pydub
|
34 |
sound = AudioSegment.from_mp3(audio_file_path)
|
35 |
sound = sound.speedup(playback_speed=speed)
|
36 |
sound.export(audio_file_path, format="mp3")
|
|
|
25 |
prompt += f"[INST] {message} [/INST]"
|
26 |
return prompt
|
27 |
|
28 |
+
def text_to_speech(text, speed=1.3):
|
29 |
tts = gTTS(text=text, lang='es')
|
30 |
audio_file_path = 'output.mp3'
|
31 |
tts.save(audio_file_path)
|
32 |
|
|
|
33 |
sound = AudioSegment.from_mp3(audio_file_path)
|
34 |
sound = sound.speedup(playback_speed=speed)
|
35 |
sound.export(audio_file_path, format="mp3")
|