Update separate.py

This commit is contained in:
Anjok07 2023-01-12 15:33:17 -06:00 committed by GitHub
parent ead667d093
commit d9b1f5317c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -870,17 +870,14 @@ def prepare_mix(mix, chunk_set, margin_set, mdx_net_cut=False, is_missing_mix=Fa
audio_path = mix
samplerate = 44100
print('mix first: ', mix)
if not isinstance(mix, np.ndarray):
mix, samplerate = librosa.load(mix, mono=False, sr=44100)
else:
mix = mix.T
print('mix: ', mix)
if not np.any(mix) and audio_path.endswith('.mp3'):
mix = rerun_mp3(audio_path)
print('mix after fix: ', mix)
if mix.ndim == 1:
mix = np.asfortranarray([mix,mix])