smjain commited on
Commit
70b1804
1 Parent(s): 9e8f99e

Upload infertest.py

Browse files
Files changed (1) hide show
  1. infertest.py +9 -9
infertest.py CHANGED
@@ -121,10 +121,10 @@ def api_convert_voice():
121
  file.save(input_audio_path)
122
 
123
  #split audio
124
- cut_vocal_and_inst(input_audio_path)
125
  print("audio splitting performed")
126
- vocal_path = f"output/{split_model}/audio/vocals.wav"
127
- inst = f"output/{split_model}/audio/no_vocals.wav"
128
 
129
  output_path = convert_voice(spk_id, vocal_path, voice_transform)
130
  output_path= combine_vocal_and_inst(output_path,inst)
@@ -436,7 +436,7 @@ def download_audio(url, audio_provider):
436
  logs.append("Download Complete.")
437
  yield audio_path, "\n".join(logs)
438
 
439
- def cut_vocal_and_inst_yt(split_model):
440
  logs = []
441
  logs.append("Starting the audio splitting process...")
442
  yield "\n".join(logs), None, None, None
@@ -446,12 +446,12 @@ def cut_vocal_and_inst_yt(split_model):
446
  logs.append(line)
447
  yield "\n".join(logs), None, None, None
448
  print(result.stdout)
449
- vocal = f"output/{split_model}/audio/vocals.wav"
450
- inst = f"output/{split_model}/audio/no_vocals.wav"
451
  logs.append("Audio splitting complete.")
452
  yield "\n".join(logs), vocal, inst, vocal
453
 
454
- def cut_vocal_and_inst(audio_path):
455
 
456
  vocal_path = "output/result/audio.wav"
457
  os.makedirs("output/result", exist_ok=True)
@@ -466,8 +466,8 @@ def cut_vocal_and_inst(audio_path):
466
  # logs.append(line)
467
  # yield "\n".join(logs), None, None
468
  print(result.stdout)
469
- vocal = f"output/{split_model}/audio/vocals.wav"
470
- inst = f"output/{split_model}/audio/no_vocals.wav"
471
  #logs.append("Audio splitting complete.")
472
 
473
 
 
121
  file.save(input_audio_path)
122
 
123
  #split audio
124
+ cut_vocal_and_inst(input_audio_path,spk_id)
125
  print("audio splitting performed")
126
+ vocal_path = f"output/{split_model}/{spk_id}_input_audio/vocals.wav"
127
+ inst = f"output/{split_model}/{spk_id}_input_audio/no_vocals.wav"
128
 
129
  output_path = convert_voice(spk_id, vocal_path, voice_transform)
130
  output_path= combine_vocal_and_inst(output_path,inst)
 
436
  logs.append("Download Complete.")
437
  yield audio_path, "\n".join(logs)
438
 
439
+ def cut_vocal_and_inst_yt(split_model,spk_id):
440
  logs = []
441
  logs.append("Starting the audio splitting process...")
442
  yield "\n".join(logs), None, None, None
 
446
  logs.append(line)
447
  yield "\n".join(logs), None, None, None
448
  print(result.stdout)
449
+ vocal = f"output/{split_model}/{spk_id}_input_audio/vocals.wav"
450
+ inst = f"output/{split_model}/{spk_id}_input_audio/no_vocals.wav"
451
  logs.append("Audio splitting complete.")
452
  yield "\n".join(logs), vocal, inst, vocal
453
 
454
+ def cut_vocal_and_inst(audio_path,spk_id):
455
 
456
  vocal_path = "output/result/audio.wav"
457
  os.makedirs("output/result", exist_ok=True)
 
466
  # logs.append(line)
467
  # yield "\n".join(logs), None, None
468
  print(result.stdout)
469
+ vocal = f"output/{split_model}/{spk_id}_input_audio/vocals.wav"
470
+ inst = f"output/{split_model}/{spk_id}_input_audio/no_vocals.wav"
471
  #logs.append("Audio splitting complete.")
472
 
473