umarabbas890 commited on
Commit
6eee829
·
verified ·
1 Parent(s): 8b0a429

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -38,15 +38,14 @@ emotion_styles = {
38
  }
39
 
40
  # Generate voice and save as MP3
41
- def generate_voice(input_text, speaker_audio_path):
42
- output_path = "output.wav"
43
  tts.tts_to_file(
44
- text=input_text,
45
  speaker_wav=speaker_audio_path,
46
- file_path=output_path
 
47
  )
48
- return output_path
49
-
50
 
51
 
52
  # Convert to MP3 using pydub
 
38
  }
39
 
40
  # Generate voice and save as MP3
41
+ def generate_voice(text, speaker_audio_path):
 
42
  tts.tts_to_file(
43
+ text=text,
44
  speaker_wav=speaker_audio_path,
45
+ language="en", # 👈 Add this line (use "en" for English, "ur" for Urdu, etc.)
46
+ file_path="output.wav"
47
  )
48
+ return "output.wav"
 
49
 
50
 
51
  # Convert to MP3 using pydub