Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -170,7 +170,7 @@ def redistribute_codes(code_list, snac_model):
|
|
170 |
audio_hat = snac_model.decode(codes)
|
171 |
return audio_hat.detach().squeeze().cpu().numpy() # Always return CPU numpy array
|
172 |
|
173 |
-
def detect_silence(audio, threshold=0.005, min_silence_duration=1.
|
174 |
sample_rate = 24000 # Adjust if your sample rate is different
|
175 |
is_silent = np.abs(audio) < threshold
|
176 |
silent_regions = np.where(is_silent)[0]
|
|
|
170 |
audio_hat = snac_model.decode(codes)
|
171 |
return audio_hat.detach().squeeze().cpu().numpy() # Always return CPU numpy array
|
172 |
|
173 |
+
def detect_silence(audio, threshold=0.005, min_silence_duration=1.3):
|
174 |
sample_rate = 24000 # Adjust if your sample rate is different
|
175 |
is_silent = np.abs(audio) < threshold
|
176 |
silent_regions = np.where(is_silent)[0]
|