Spaces:
Running
Running
deveix
commited on
Commit
•
3a54f53
1
Parent(s):
ab6e218
leave silence
Browse files- app/main.py +3 -3
app/main.py
CHANGED
@@ -190,9 +190,9 @@ label_encoder = joblib.load('app/1713661470.6730225_label_encoder.joblib')
|
|
190 |
def preprocess_audio(audio_data, rate):
|
191 |
audio_data = nr.reduce_noise(y=audio_data, sr=rate)
|
192 |
# remove silence
|
193 |
-
intervals = librosa.effects.split(audio_data, top_db=20)
|
194 |
-
# Concatenate non-silent intervals
|
195 |
-
audio_data = np.concatenate([audio_data[start:end] for start, end in intervals])
|
196 |
|
197 |
audio_data = librosa.util.normalize(audio_data)
|
198 |
audio_data, _ = librosa.effects.trim(audio_data)
|
|
|
190 |
def preprocess_audio(audio_data, rate):
|
191 |
audio_data = nr.reduce_noise(y=audio_data, sr=rate)
|
192 |
# remove silence
|
193 |
+
# intervals = librosa.effects.split(audio_data, top_db=20)
|
194 |
+
# # Concatenate non-silent intervals
|
195 |
+
# audio_data = np.concatenate([audio_data[start:end] for start, end in intervals])
|
196 |
|
197 |
audio_data = librosa.util.normalize(audio_data)
|
198 |
audio_data, _ = librosa.effects.trim(audio_data)
|