umarabbas890 commited on
Commit
24a2cee
·
verified ·
1 Parent(s): 8855e58

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
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
- tts.tts_to_file(
50
- text=script,
51
- speaker_wav=None,
52
- language="en",
53
- file_path=output_path,
54
- style_wav=None,
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")