声音功能属性错误: 'rmse'



在使用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]

你应该没事。

最新更新