Spaces:
Running
Running
kevinwang676
commited on
Commit
•
f678c0d
1
Parent(s):
6fac9a8
Update app.py
Browse files
app.py
CHANGED
@@ -275,22 +275,25 @@ def convert(start_time, song_name_src, song_name_ref, src_audio, ref_audio, chec
|
|
275 |
os.system(f"python inference.py --src_wav_path audio_src.wav --ref_wav_path voiced_audio.wav --speech_enroll")
|
276 |
else:
|
277 |
os.system(f"python inference.py --src_wav_path audio_src.wav --ref_wav_path voiced_audio.wav --key_shift {key_shift} --speech_enroll")
|
278 |
-
|
279 |
-
audio_vocal = AudioSegment.from_file("output_svc/NeuCoSVCv2.wav", format="wav")
|
280 |
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
#
|
291 |
-
|
292 |
-
|
293 |
-
|
|
|
|
|
|
|
|
|
|
|
294 |
|
295 |
|
296 |
|
|
|
275 |
os.system(f"python inference.py --src_wav_path audio_src.wav --ref_wav_path voiced_audio.wav --speech_enroll")
|
276 |
else:
|
277 |
os.system(f"python inference.py --src_wav_path audio_src.wav --ref_wav_path voiced_audio.wav --key_shift {key_shift} --speech_enroll")
|
|
|
|
|
278 |
|
279 |
+
if src_audio is None:
|
280 |
+
return "output_svc/NeuCoSVCv2.wav"
|
281 |
+
else:
|
282 |
+
audio_vocal = AudioSegment.from_file("output_svc/NeuCoSVCv2.wav", format="wav")
|
283 |
+
|
284 |
+
# Load the second audio file
|
285 |
+
audio_inst = AudioSegment.from_file(f"output/{split_model}/{song_id_src}/instrument_{song_id_src}.wav_10.wav", format="wav")
|
286 |
+
|
287 |
+
audio_vocal = audio_vocal + vocal_vol # Increase volume of the first audio by 5 dB
|
288 |
+
audio_inst = audio_inst + inst_vol # Decrease volume of the second audio by 5 dB
|
289 |
+
|
290 |
+
# Concatenate audio files
|
291 |
+
combined_audio = audio_vocal.overlay(audio_inst)
|
292 |
+
|
293 |
+
# Export the concatenated audio to a new file
|
294 |
+
combined_audio.export(f"{song_name_src}-AI翻唱.wav", format="wav")
|
295 |
+
|
296 |
+
return f"{song_name_src}-AI翻唱.wav"
|
297 |
|
298 |
|
299 |
|