tommy24 commited on
Commit
24a8041
·
1 Parent(s): 3b3f91f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -217,10 +217,16 @@ def function(Textbox, Textbox2, Textbox3, Dropdown):
217
  }
218
  )
219
  output = output["audio_out"]
220
- mp3_data = BytesIO()
221
- output.export(mp3_data, format="mp3")
222
- mp3_data.seek(0)
223
- return mp3_data.read()
 
 
 
 
 
 
224
  except Exception as e:
225
  print(traceback.format_exc())
226
  return "Please Wait!"
 
217
  }
218
  )
219
  output = output["audio_out"]
220
+ audio_data = base64.b64decode(output)
221
+ return audio data
222
+
223
+ # Save the audio to an MP3 file
224
+ # mp3_path = "output.mp3"
225
+ # with open(mp3_path, "wb") as f:
226
+ # f.write(audio_data)
227
+
228
+ # # Return the path to the MP3 file
229
+ # return mp3_path
230
  except Exception as e:
231
  print(traceback.format_exc())
232
  return "Please Wait!"