Update app.py
Browse files
app.py
CHANGED
@@ -19,11 +19,11 @@ def audio_separation():
|
|
19 |
# 下载MP3文件到本地
|
20 |
response = requests.get(mp3_url)
|
21 |
mp3_filename = mp3_url.split('/')[-1] # 使用下载的文件名
|
22 |
-
with open(mp3_filename, 'wb') as f:
|
23 |
f.write(response.content)
|
24 |
|
25 |
# 执行音频分离操作
|
26 |
-
subprocess.run(['python', 'separate.py', mp3_filename, '-m', './models/MDX_Net_Models/UVR-MDX-NET-Inst_HQ_3.onnx'])
|
27 |
|
28 |
# 生成分离后的文件名
|
29 |
vocals_filename = f"{os.path.splitext(mp3_filename)[0]}_vocals.wav"
|
|
|
19 |
# 下载MP3文件到本地
|
20 |
response = requests.get(mp3_url)
|
21 |
mp3_filename = mp3_url.split('/')[-1] # 使用下载的文件名
|
22 |
+
with open("/tmp/" + mp3_filename, 'wb') as f:
|
23 |
f.write(response.content)
|
24 |
|
25 |
# 执行音频分离操作
|
26 |
+
subprocess.run(['python', 'separate.py', "/tmp/" + mp3_filename, '-m', './models/MDX_Net_Models/UVR-MDX-NET-Inst_HQ_3.onnx'])
|
27 |
|
28 |
# 生成分离后的文件名
|
29 |
vocals_filename = f"{os.path.splitext(mp3_filename)[0]}_vocals.wav"
|