MAKHLWF commited on
Commit
f7a0960
·
1 Parent(s): 8b390e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,7 +10,7 @@ def text_to_speech(text):
10
  mp3_data = io.BytesIO()
11
  speech.save(mp3_data)
12
  mp3_data.seek(0)
13
- return mp3_data.getvalue() # Use getvalue() instead of read()
14
  except Exception as e:
15
  return str(e)
16
  else:
@@ -19,7 +19,7 @@ def text_to_speech(text):
19
  iface = gr.Interface(
20
  fn=text_to_speech,
21
  inputs=gr.inputs.Textbox(default="Enter text here...", label="Input Text"),
22
- outputs=gr.outputs.Audio(type="bytes", label="Voice", mime="audio/mpeg"), # Specify content type
23
  title="Text to Speech",
24
  description="Enter text and click 'Generate' to convert it to speech.",
25
  theme="blue",
 
10
  mp3_data = io.BytesIO()
11
  speech.save(mp3_data)
12
  mp3_data.seek(0)
13
+ return mp3_data.getvalue()
14
  except Exception as e:
15
  return str(e)
16
  else:
 
19
  iface = gr.Interface(
20
  fn=text_to_speech,
21
  inputs=gr.inputs.Textbox(default="Enter text here...", label="Input Text"),
22
+ outputs=gr.outputs.Audio(type="bytes", label="Voice"), # Removed the mime parameter
23
  title="Text to Speech",
24
  description="Enter text and click 'Generate' to convert it to speech.",
25
  theme="blue",