szili2011 commited on
Commit
af5b23f
·
verified ·
1 Parent(s): 378e118

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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