ariankhalfani commited on
Commit
5530ee1
·
verified ·
1 Parent(s): 86e1c2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -38,7 +38,7 @@ def generate_speech(api_token, answer):
38
  try:
39
  response.raise_for_status() # Raise an error for bad responses
40
  audio = response.content
41
- audio_segment = AudioSegment.from_file(BytesIO(audio), format="wav")
42
  audio_file_path = "/tmp/answer.wav"
43
  audio_segment.export(audio_file_path, format="wav")
44
  return audio_file_path
@@ -76,4 +76,4 @@ iface = gr.Interface(
76
 
77
  # Launch the Gradio app
78
  if __name__ == "__main__":
79
- iface.launch()
 
38
  try:
39
  response.raise_for_status() # Raise an error for bad responses
40
  audio = response.content
41
+ audio_segment = AudioSegment.from_file(BytesIO(audio), format="flac")
42
  audio_file_path = "/tmp/answer.wav"
43
  audio_segment.export(audio_file_path, format="wav")
44
  return audio_file_path
 
76
 
77
  # Launch the Gradio app
78
  if __name__ == "__main__":
79
+ iface.launch(share=True)