helloWorld199 commited on
Commit
3ad2935
1 Parent(s): cde585c

Update src/main.py

Browse files
Files changed (1) hide show
  1. src/main.py +11 -11
src/main.py CHANGED
@@ -277,15 +277,15 @@ def vocal_only_pipeline(song_input, voice_model, pitch_change, is_webui=0,index_
277
  orig_song_path, vocals_path = preprocess_vocals_only(song_input, mdx_model_params, song_id, is_webui, input_type, progress)
278
  else:
279
  vocals_path = None
280
- for file in os.listdir(song_dir):
281
- vocals_path = os.path.join(song_dir, file)
282
- return vocals_path
283
 
284
- # if any of the audio files aren't available or keep intermediate files, rerun preprocess
285
- #if any(path is None for path in paths):
286
- # orig_song_path, vocals_path= preprocess_vocals_only(song_input, mdx_model_params, song_id, is_webui, input_type, progress)
287
- #else:
288
- # orig_song_path = paths
289
  #orig_song_path, vocals_path = preprocess_vocals_only(song_input, mdx_model_params, song_id, is_webui, input_type, progress)
290
 
291
  pitch_change = pitch_change * 12 + pitch_change_all
@@ -295,10 +295,10 @@ def vocal_only_pipeline(song_input, voice_model, pitch_change, is_webui=0,index_
295
 
296
  display_progress('[~] Converting voice using RVC...', 0.5, is_webui, progress)
297
  voice_change(voice_model, vocals_path, ai_vocals_path, pitch_change, f0_method, index_rate, filter_radius, rms_mix_rate, protect, crepe_hop_length, is_webui)
298
- display_progress('[~] Applying audio effects to Vocals...', 0.8, is_webui, progress)
299
- ai_vocals_mixed_path = add_audio_effects(ai_vocals_path, reverb_rm_size, reverb_wet, reverb_dry, reverb_damping)
300
 
301
- return ai_vocals_mixed_path
302
  except Exception as e:
303
  raise_exception(str(e), is_webui)
304
 
 
277
  orig_song_path, vocals_path = preprocess_vocals_only(song_input, mdx_model_params, song_id, is_webui, input_type, progress)
278
  else:
279
  vocals_path = None
280
+ #for file in os.listdir(song_dir):
281
+ # vocals_path = os.path.join(song_dir, file)
282
+ #return vocals_path
283
 
284
+ #if any of the audio files aren't available or keep intermediate files, rerun preprocess
285
+ if any(path is None for path in paths):
286
+ orig_song_path, vocals_path= preprocess_vocals_only(song_input, mdx_model_params, song_id, is_webui, input_type, progress)
287
+ else:
288
+ orig_song_path = paths
289
  #orig_song_path, vocals_path = preprocess_vocals_only(song_input, mdx_model_params, song_id, is_webui, input_type, progress)
290
 
291
  pitch_change = pitch_change * 12 + pitch_change_all
 
295
 
296
  display_progress('[~] Converting voice using RVC...', 0.5, is_webui, progress)
297
  voice_change(voice_model, vocals_path, ai_vocals_path, pitch_change, f0_method, index_rate, filter_radius, rms_mix_rate, protect, crepe_hop_length, is_webui)
298
+ #display_progress('[~] Applying audio effects to Vocals...', 0.8, is_webui, progress)
299
+ #ai_vocals_mixed_path = add_audio_effects(ai_vocals_path, reverb_rm_size, reverb_wet, reverb_dry, reverb_damping)
300
 
301
+ return ai_vocals_path
302
  except Exception as e:
303
  raise_exception(str(e), is_webui)
304