Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sound feature attributeError: 'rmse'

In using librosa.feature.rmse for sound feature extraction, I have the following:

import librosa
import numpy as np 

wav_file = "C://TEM//tem//CantinaBand3.wav"
y, sr = librosa.load(wav_file)

chroma_stft = librosa.feature.chroma_stft(y=y, sr=sr)

rmse=librosa.feature.rmse(y=y)[0]

print rmse

It gives me:

AttributeError: 'module' object has no attribute 'rmse'

What's the right way to get it?

Sample file: https://www2.cs.uic.edu/~i101/SoundFiles/CantinaBand3.wav

like image 465
Mark K Avatar asked Jan 25 '23 13:01

Mark K


1 Answers

I am guessing you are running one of the latest librosa. If you check the changelog for the 0.7, you will notice that rmse was dropped in favour of rms. Simply run:

rmse=librosa.feature.rms(y=y)[0]

and you should be fine.

like image 60
Lukasz Tracewski Avatar answered Jan 31 '23 09:01

Lukasz Tracewski