Why this error in Ubantu 20.04?

162 views
Skip to first unread message

KRISHNA CHAUHAN

unread,
Jul 14, 2023, 2:02:07 AM7/14/23
to librosa
Hello there 
I hace changed my OS from windows to Ubantu 20.04, and now in same script getting this error while extracting features using Librosa. Please guide its urgent also.

 if mel:
            mel = np.mean(librosa.feature.melspectrogram(X, sr=sample_rate).T, axis=0)
            result = np.hstack((result, mel))



The error is 

TypeError: melspectrogram() takes 0 positional arguments but 1 positional argument (and 1 keyword-only argument) were given

Brian McFee

unread,
Jul 14, 2023, 12:36:01 PM7/14/23
to librosa
This should have nothing to do with your OS, and everything to do with which version of librosa you're using. Since 0.10, you need to specify your input parameter names explciitly.  Eg, if X is your audio signal, then you need to say librosa.feature.melspectrogram(y=X, sr=sample_rate).
Reply all
Reply to author
Forward
0 new messages