首页 > 解决方案 > 声音特征属性错误:'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

标签: pythonaudiofeature-extractionlibrosa

解决方案


我猜你正在运行最新的librosa. 如果您检查 的更改日志0.7您会注意到它rmse已被删除,而支持rms. 只需运行:

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

你应该没事。


推荐阅读