Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import librosa
|
|
7 |
|
8 |
def resample_audio(audio, target_sample_rate):
|
9 |
current_sample_rate, audio_data = audio
|
10 |
-
|
11 |
if current_sample_rate != target_sample_rate:
|
12 |
resampled_audio_data = librosa.resample(audio_data, orig_sr=current_sample_rate, target_sr=target_sample_rate)
|
13 |
return target_sample_rate, resampled_audio_data
|
|
|
7 |
|
8 |
def resample_audio(audio, target_sample_rate):
|
9 |
current_sample_rate, audio_data = audio
|
10 |
+
audio_data = audio_data.astype(np.float32)
|
11 |
if current_sample_rate != target_sample_rate:
|
12 |
resampled_audio_data = librosa.resample(audio_data, orig_sr=current_sample_rate, target_sr=target_sample_rate)
|
13 |
return target_sample_rate, resampled_audio_data
|