Skip to content
Advertisement

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

Advertisement

Answer

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.

Advertisement