Amamrnaf commited on
Commit
5be0054
·
1 Parent(s): 5092159
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -8,10 +8,9 @@ def process_audio(input_text, speaker_audio, speaker_name, option_selected):
8
  os.makedirs("./tmp/audio/input_src/", exist_ok=True)
9
  os.makedirs("audio", exist_ok=True)
10
 
11
- # Save speaker audio to the required location
12
  speaker_audio_path = "./tmp/audio/input_src/0.wav"
13
- with open(speaker_audio_path, "wb") as f:
14
- f.write(speaker_audio)
15
 
16
  # Check selected option and execute corresponding function
17
  if option_selected == "Xtts_v2":
@@ -37,14 +36,14 @@ with gr.Blocks() as demo:
37
  text_input = gr.Textbox(label="Input Text", placeholder="Enter your text here.")
38
 
39
  with gr.Row():
40
- speaker_audio = gr.Audio(label="Speaker Audio (to be cloned)",type='filepath', format='wav')
41
  speaker_name = gr.Textbox(label="Speaker Name", placeholder="Enter the speaker's name.")
42
 
43
  option_selected = gr.Dropdown(choices=["Xtts_v2", "metaVoice(not working at the moment)", "more"], label="Select an Option")
44
 
45
  submit_btn = gr.Button("Submit")
46
 
47
- output_audio = gr.Audio(label="Generated Audio Output")
48
 
49
  submit_btn.click(
50
  fn=process_audio,
 
8
  os.makedirs("./tmp/audio/input_src/", exist_ok=True)
9
  os.makedirs("audio", exist_ok=True)
10
 
11
+ # Copy speaker audio to the required location
12
  speaker_audio_path = "./tmp/audio/input_src/0.wav"
13
+ os.rename(speaker_audio, speaker_audio_path)
 
14
 
15
  # Check selected option and execute corresponding function
16
  if option_selected == "Xtts_v2":
 
36
  text_input = gr.Textbox(label="Input Text", placeholder="Enter your text here.")
37
 
38
  with gr.Row():
39
+ speaker_audio = gr.Audio(label="Speaker Audio (to be cloned)", type='filepath', format='wav')
40
  speaker_name = gr.Textbox(label="Speaker Name", placeholder="Enter the speaker's name.")
41
 
42
  option_selected = gr.Dropdown(choices=["Xtts_v2", "metaVoice(not working at the moment)", "more"], label="Select an Option")
43
 
44
  submit_btn = gr.Button("Submit")
45
 
46
+ output_audio = gr.Audio(label="Generated Audio Output", type='filepath')
47
 
48
  submit_btn.click(
49
  fn=process_audio,