kevinwang676 commited on
Commit
0744265
1 Parent(s): 8828a54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -72,9 +72,10 @@ def generate_voice(text, voice_name):
72
  voice=voice_name,
73
  model="eleven_multilingual_v2"
74
  )
75
- #write("output.wav", 44100, np.frombuffer(pad_buffer(audio), dtype=np.int16))
76
-
77
- return (44100, np.frombuffer(pad_buffer(audio), dtype=np.int16))
 
78
  except UnauthenticatedRateLimitError as e:
79
  raise gr.Error("Thanks for trying out ElevenLabs TTS! You've reached the free tier limit. Please provide an API key to continue.")
80
  except Exception as e:
 
72
  voice=voice_name,
73
  model="eleven_multilingual_v2"
74
  )
75
+ with open("output" + ".mp3", mode='wb') as f:
76
+ f.write(audio)
77
+ return "output.mp3"
78
+
79
  except UnauthenticatedRateLimitError as e:
80
  raise gr.Error("Thanks for trying out ElevenLabs TTS! You've reached the free tier limit. Please provide an API key to continue.")
81
  except Exception as e: