Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ def load_audio(file):
|
|
10 |
|
11 |
def get_segment(audio, sr):
|
12 |
# Calculate onset envelope and detect onsets
|
13 |
-
onset_env = librosa.onset.onset_strength(audio, sr=sr)
|
14 |
onset_frames = librosa.onset.onset_detect(onset_envelope=onset_env, sr=sr, backtrack=True)
|
15 |
|
16 |
# If no onsets are detected, return a segment from the beginning
|
|
|
10 |
|
11 |
def get_segment(audio, sr):
|
12 |
# Calculate onset envelope and detect onsets
|
13 |
+
onset_env = librosa.onset.onset_strength(y=audio, sr=sr) # Fixed the argument here
|
14 |
onset_frames = librosa.onset.onset_detect(onset_envelope=onset_env, sr=sr, backtrack=True)
|
15 |
|
16 |
# If no onsets are detected, return a segment from the beginning
|