Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -227,7 +227,7 @@ def get_audio_duration(path):
|
|
227 |
return len(audio) / 1000
|
228 |
def select_audio_file(wav_paths):
|
229 |
import random
|
230 |
-
eligible_files = [path for path in wav_paths if 2 <= get_audio_duration(path) <=
|
231 |
if eligible_files:
|
232 |
selected_file = random.choice(eligible_files)
|
233 |
else:
|
|
|
227 |
return len(audio) / 1000
|
228 |
def select_audio_file(wav_paths):
|
229 |
import random
|
230 |
+
eligible_files = [path for path in wav_paths if 2 <= get_audio_duration(path) <= 5]
|
231 |
if eligible_files:
|
232 |
selected_file = random.choice(eligible_files)
|
233 |
else:
|