Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,15 +24,15 @@ 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 |
-
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(
|
32 |
|
33 |
# Convert vocals to audio data
|
34 |
vocals_data = vocals['vocals'].flatten().astype(np.int16).tobytes()
|
35 |
-
|
36 |
|
37 |
# Return processed data for output
|
38 |
return vocals_data, pyaudio.paContinue, processed_audio
|
|
|
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(input_file)
|
32 |
|
33 |
# Convert vocals to audio data
|
34 |
vocals_data = vocals['vocals'].flatten().astype(np.int16).tobytes()
|
35 |
+
processed_audio = vocals_data
|
36 |
|
37 |
# Return processed data for output
|
38 |
return vocals_data, pyaudio.paContinue, processed_audio
|