Vageesh1 commited on
Commit
67ca6ac
·
1 Parent(s): 5ed3033

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -22,6 +22,10 @@ def translate(text):
22
  return result
23
 
24
 
 
 
 
 
25
  def ui():
26
  st.title('Multi Lingual Voice Cloner')
27
  st.markdown("Made by vageesh")
@@ -29,6 +33,9 @@ def ui():
29
  #audio input box
30
  audio_file = st.file_uploader("Upload an audio file that needs to be cloned", type=[ "wav,Mp4","Mp3"])
31
  if audio_file is not None:
 
 
 
32
  user_api_key = st.sidebar.text_input(
33
  label="#### Your Eleven Labs API key here 👇",
34
  placeholder="Paste your Eleven Labs API key API key, sk-",
 
22
  return result
23
 
24
 
25
+ def save_uploaded_file(uploaded_file, output_file_path):
26
+ with open(output_file_path, "wb") as f:
27
+ f.write(uploaded_file.getbuffer())
28
+
29
  def ui():
30
  st.title('Multi Lingual Voice Cloner')
31
  st.markdown("Made by vageesh")
 
33
  #audio input box
34
  audio_file = st.file_uploader("Upload an audio file that needs to be cloned", type=[ "wav,Mp4","Mp3"])
35
  if audio_file is not None:
36
+ output_file_path = "./output_audio.mp3"
37
+ save_uploaded_file(audio_file, output_file_path)
38
+ st.success(f"Audio file saved as {output_file_path}")
39
  user_api_key = st.sidebar.text_input(
40
  label="#### Your Eleven Labs API key here 👇",
41
  placeholder="Paste your Eleven Labs API key API key, sk-",