Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ def generate_mel_spectrogram(audio_path, sr=22050, n_mels=128, fmin=0, fmax=7000
|
|
| 20 |
|
| 21 |
def detect_zero_db(spectrogram):
|
| 22 |
# Create a binary mask where the spectrogram values are close to 0 dB
|
| 23 |
-
threshold = -
|
| 24 |
mask = np.isclose(spectrogram, threshold, atol=10) # Use a tolerance to include values close to 0 dB
|
| 25 |
|
| 26 |
return mask
|
|
|
|
| 20 |
|
| 21 |
def detect_zero_db(spectrogram):
|
| 22 |
# Create a binary mask where the spectrogram values are close to 0 dB
|
| 23 |
+
threshold = -40 # +0 dB threshold
|
| 24 |
mask = np.isclose(spectrogram, threshold, atol=10) # Use a tolerance to include values close to 0 dB
|
| 25 |
|
| 26 |
return mask
|