在使用librosa.feature.rmse进行声音特征提取时,我有以下内容:
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
它给了我:
AttributeError: 'module' object has no attribute 'rmse'
获得它的正确方法是什么?
示例文件:https://www2.cs.uic.edu/~i101/SoundFiles/CantinaBand3.wav
我猜您正在运行最新的librosa
之一。如果您检查0.7
的更改日志,您会注意到rmse
已被放弃,转而支持rms
。只需运行:
rmse=librosa.feature.rms(y=y)[0]
你应该没事。