rename to run_uvr_job
Browse files
inst.py
CHANGED
@@ -99,7 +99,7 @@ def ensemble(stem_outputs, stem_save_path, format=WAV):
|
|
99 |
save_format(stem_save_path, format, '320k')
|
100 |
|
101 |
|
102 |
-
def
|
103 |
audio_dir = os.getcwd()
|
104 |
audio_file = f'{song_id}.m4a' if platform == 'youtube' else f'{song_id}.mp3'
|
105 |
audio_path = os.path.join(audio_dir, audio_file)
|
@@ -110,7 +110,7 @@ def uvr_job(song_id, platform='netease'):
|
|
110 |
open(audio_path, 'wb').write(r.content)
|
111 |
|
112 |
instrumental_path, vocals_path = run_ensemble_models(audio_file, audio_dir)
|
113 |
-
return instrumental_path
|
114 |
|
115 |
|
116 |
# /Users/taoluo/Downloads/test/kimk_audio_MDX23C-8KFFT-InstVoc_HQ_(Instrumental).WAV
|
@@ -129,5 +129,5 @@ if __name__ == '__main__':
|
|
129 |
|
130 |
# download from platform
|
131 |
song_id = sys.argv[1]
|
132 |
-
instrumental_path =
|
133 |
print('instrumental_path: ', instrumental_path)
|
|
|
99 |
save_format(stem_save_path, format, '320k')
|
100 |
|
101 |
|
102 |
+
def run_uvr_job(song_id, platform='netease'):
|
103 |
audio_dir = os.getcwd()
|
104 |
audio_file = f'{song_id}.m4a' if platform == 'youtube' else f'{song_id}.mp3'
|
105 |
audio_path = os.path.join(audio_dir, audio_file)
|
|
|
110 |
open(audio_path, 'wb').write(r.content)
|
111 |
|
112 |
instrumental_path, vocals_path = run_ensemble_models(audio_file, audio_dir)
|
113 |
+
return instrumental_path, vocals_path
|
114 |
|
115 |
|
116 |
# /Users/taoluo/Downloads/test/kimk_audio_MDX23C-8KFFT-InstVoc_HQ_(Instrumental).WAV
|
|
|
129 |
|
130 |
# download from platform
|
131 |
song_id = sys.argv[1]
|
132 |
+
instrumental_path, vocals_path = run_uvr_job(song_id, platform)
|
133 |
print('instrumental_path: ', instrumental_path)
|