Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,11 +24,11 @@ def audio_preprocess(input_file): #, in_data, frame_count, time_info, status):
|
|
24 |
|
25 |
global vocals_data
|
26 |
# Convert input data to numpy array
|
27 |
-
|
28 |
|
29 |
# Perform vocal removal on the audio input
|
30 |
# Pass the audio array as waveform to separate() method
|
31 |
-
vocals = Separator('spleeter:2stems').separate(
|
32 |
|
33 |
# Convert vocals to audio data
|
34 |
vocals_data = vocals['vocals'].flatten().astype(np.int16).tobytes()
|
|
|
24 |
|
25 |
global vocals_data
|
26 |
# Convert input data to numpy array
|
27 |
+
audio_array = np.frombuffer(input_file, dtype=np.int16)
|
28 |
|
29 |
# Perform vocal removal on the audio input
|
30 |
# Pass the audio array as waveform to separate() method
|
31 |
+
vocals = Separator('spleeter:2stems').separate(audio_array)
|
32 |
|
33 |
# Convert vocals to audio data
|
34 |
vocals_data = vocals['vocals'].flatten().astype(np.int16).tobytes()
|