Update app.py
Browse files
app.py
CHANGED
|
@@ -46,14 +46,12 @@ def generate_voice(script, emotion):
|
|
| 46 |
|
| 47 |
# Generate speech (XTTS auto-selects English and supports style)
|
| 48 |
output_path = f"output_{uuid.uuid4().hex}.wav"
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
style=style
|
| 56 |
-
)
|
| 57 |
|
| 58 |
# Convert to MP3 using pydub
|
| 59 |
mp3_path = output_path.replace(".wav", ".mp3")
|
|
|
|
| 46 |
|
| 47 |
# Generate speech (XTTS auto-selects English and supports style)
|
| 48 |
output_path = f"output_{uuid.uuid4().hex}.wav"
|
| 49 |
+
tts.tts_to_file(
|
| 50 |
+
text=input_text,
|
| 51 |
+
speaker_wav=speaker_audio_path,
|
| 52 |
+
file_path=output_path
|
| 53 |
+
)
|
| 54 |
+
|
|
|
|
|
|
|
| 55 |
|
| 56 |
# Convert to MP3 using pydub
|
| 57 |
mp3_path = output_path.replace(".wav", ".mp3")
|