Skip to content

Commit 55efa4d

Browse files
authored
Update feat_extract.py
forcing asfortranarray to address the librosa ParameterError "Audio buffer is not Fortran-contiguous.... "
1 parent eb3e4de commit 55efa4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyaudioclassification/feat_extract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def extract_feature(file_name):
1515
if X.ndim > 1:
1616
X = X[:,0]
1717
X = X.T
18-
18+
X = np.asfortranarray(X)
1919
stft = np.abs(librosa.stft(X))
2020
mfccs = np.mean(librosa.feature.mfcc(y=X, sr=sample_rate, n_mfcc=40).T,axis=0)
2121
chroma = np.mean(librosa.feature.chroma_stft(S=stft, sr=sample_rate).T,axis=0)

0 commit comments

Comments
 (0)