ArkanDash commited on
Commit
c575521
1 Parent(s): 94baf6d

feat(gc): Added vocal volume

Browse files
Files changed (2) hide show
  1. app-full.py +16 -6
  2. app.py +1 -0
app-full.py CHANGED
@@ -104,7 +104,7 @@ def cut_vocal_and_inst(yt_url):
104
  print(result.stdout.decode())
105
  return ("/content/rvc-models/separated/htdemucs/audio/vocals.wav", "/content/rvc-models/separated/htdemucs/audio/no_vocals.wav", yt_audio_path, "/content/rvc-models/separated/htdemucs/audio/vocals.wav")
106
 
107
- def combine_vocal_and_inst(audio_data):
108
  print(audio_data)
109
  if not os.path.exists("/content/result"):
110
  os.mkdir("/content/result")
@@ -116,7 +116,7 @@ def combine_vocal_and_inst(audio_data):
116
  wave_file.setsampwidth(2)
117
  wave_file.setframerate(audio_data[0])
118
  wave_file.writeframes(audio_data[1].tobytes())
119
- command = f'ffmpeg -y -i {inst_path} -i {vocal_path} -filter_complex [1:a]volume=6dB[v];[0:a][v]amix=inputs=2:duration=longest -b:a 320k -c:a libmp3lame {output_path}'
120
  result = subprocess.run(command.split(), stdout=subprocess.PIPE)
121
  return output_path
122
 
@@ -181,6 +181,7 @@ if __name__ == '__main__':
181
  gr.Markdown(
182
  "# <center> RVC Models\n"
183
  "## <center> The input audio should be clean and pure voice without background music.\n"
 
184
  "![visitor badge](https://visitor-badge.glitch.me/badge?page_id=ArkanDash.Rvc-Models)\n\n"
185
  "[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1hx6kKvIuv5XNY1Gai2PEuZhpO5z6xpVh?usp=sharing)\n\n"
186
  "[![Original Repo](https://badgen.net/badge/icon/github?icon=github&label=Original%20Repo)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI)"
@@ -227,14 +228,23 @@ if __name__ == '__main__':
227
  tts_text = gr.Textbox(visible=False,label="TTS text (100 words limitation)" if limitation else "TTS text")
228
  tts_voice = gr.Dropdown(label="Edge-tts speaker", choices=voices, visible=False, allow_custom_value=False, value="en-US-AnaNeural-Female")
229
  vc_submit = gr.Button("Generate", variant="primary")
230
- with gr.Column():
231
  vc_output1 = gr.Textbox(label="Output Message")
232
  vc_output2 = gr.Audio(label="Output Audio")
233
- vc_combine = gr.Button("Combine",variant="primary")
234
- vc_outputCombine = gr.Audio(label="Output Combined Audio")
 
 
 
 
 
 
 
 
 
 
235
  vc_submit.click(vc_fn, [vc_input, vc_transpose, vc_f0method, vc_index_ratio, tts_mode, tts_text, tts_voice], [vc_output1, vc_output2])
236
  tts_mode.change(change_to_tts_mode, [tts_mode], [vc_input, tts_text, tts_voice])
237
  if args.files:
238
  vc_convert.click(cut_vocal_and_inst, vc_youtube, [vc_vocal_preview, vc_inst_preview, vc_audio_preview, vc_input])
239
- vc_combine.click(combine_vocal_and_inst, vc_output2, vc_outputCombine)
240
  app.queue(concurrency_count=1, max_size=20, api_open=args.api).launch(share=args.share)
 
104
  print(result.stdout.decode())
105
  return ("/content/rvc-models/separated/htdemucs/audio/vocals.wav", "/content/rvc-models/separated/htdemucs/audio/no_vocals.wav", yt_audio_path, "/content/rvc-models/separated/htdemucs/audio/vocals.wav")
106
 
107
+ def combine_vocal_and_inst(audio_data, audio_volume):
108
  print(audio_data)
109
  if not os.path.exists("/content/result"):
110
  os.mkdir("/content/result")
 
116
  wave_file.setsampwidth(2)
117
  wave_file.setframerate(audio_data[0])
118
  wave_file.writeframes(audio_data[1].tobytes())
119
+ command = f'ffmpeg -y -i {inst_path} -i {vocal_path} -filter_complex [1:a]volume={audio_volume}dB[v];[0:a][v]amix=inputs=2:duration=longest -b:a 320k -c:a libmp3lame {output_path}'
120
  result = subprocess.run(command.split(), stdout=subprocess.PIPE)
121
  return output_path
122
 
 
181
  gr.Markdown(
182
  "# <center> RVC Models\n"
183
  "## <center> The input audio should be clean and pure voice without background music.\n"
184
+ "### <center> More feature will be added soon... \n"
185
  "![visitor badge](https://visitor-badge.glitch.me/badge?page_id=ArkanDash.Rvc-Models)\n\n"
186
  "[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1hx6kKvIuv5XNY1Gai2PEuZhpO5z6xpVh?usp=sharing)\n\n"
187
  "[![Original Repo](https://badgen.net/badge/icon/github?icon=github&label=Original%20Repo)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI)"
 
228
  tts_text = gr.Textbox(visible=False,label="TTS text (100 words limitation)" if limitation else "TTS text")
229
  tts_voice = gr.Dropdown(label="Edge-tts speaker", choices=voices, visible=False, allow_custom_value=False, value="en-US-AnaNeural-Female")
230
  vc_submit = gr.Button("Generate", variant="primary")
 
231
  vc_output1 = gr.Textbox(label="Output Message")
232
  vc_output2 = gr.Audio(label="Output Audio")
233
+ if args.files:
234
+ with gr.Column():
235
+ vc_volume = gr.Slider(
236
+ minimum=0,
237
+ maximum=10,
238
+ label="Vocal volume",
239
+ value=5,
240
+ interactive=True,
241
+ step=1
242
+ )
243
+ vc_outputCombine = gr.Audio(label="Output Combined Audio")
244
+ vc_combine = gr.Button("Combine",variant="primary")
245
  vc_submit.click(vc_fn, [vc_input, vc_transpose, vc_f0method, vc_index_ratio, tts_mode, tts_text, tts_voice], [vc_output1, vc_output2])
246
  tts_mode.change(change_to_tts_mode, [tts_mode], [vc_input, tts_text, tts_voice])
247
  if args.files:
248
  vc_convert.click(cut_vocal_and_inst, vc_youtube, [vc_vocal_preview, vc_inst_preview, vc_audio_preview, vc_input])
249
+ vc_combine.click(combine_vocal_and_inst, [vc_output2, vc_volume], vc_outputCombine)
250
  app.queue(concurrency_count=1, max_size=20, api_open=args.api).launch(share=args.share)
app.py CHANGED
@@ -139,6 +139,7 @@ if __name__ == '__main__':
139
  gr.Markdown(
140
  "# <center> RVC Models\n"
141
  "## <center> The input audio should be clean and pure voice without background music.\n"
 
142
  "![visitor badge](https://visitor-badge.glitch.me/badge?page_id=ArkanDash.Rvc-Models)\n\n"
143
  "[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1hx6kKvIuv5XNY1Gai2PEuZhpO5z6xpVh?usp=sharing)\n\n"
144
  "[![Original Repo](https://badgen.net/badge/icon/github?icon=github&label=Original%20Repo)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI)"
 
139
  gr.Markdown(
140
  "# <center> RVC Models\n"
141
  "## <center> The input audio should be clean and pure voice without background music.\n"
142
+ "#### <center> Recommended to use the Google Colab version for more feature.\n"
143
  "![visitor badge](https://visitor-badge.glitch.me/badge?page_id=ArkanDash.Rvc-Models)\n\n"
144
  "[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1hx6kKvIuv5XNY1Gai2PEuZhpO5z6xpVh?usp=sharing)\n\n"
145
  "[![Original Repo](https://badgen.net/badge/icon/github?icon=github&label=Original%20Repo)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI)"