python - 声音特征属性错误:'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]
你应该没事。
推荐阅读
- android - 片段无法处理许多编辑文本
- php - 缺少路由资源显示所需的参数
- javascript - toISOString() 从值中减去天
- visual-studio - 在 Visual Studio 中编辑 RDL 文件
- vb.net - 如何在 vb.net 中的系列图表上获取 HitTest 的 XY 值
- python - SQLAlchemy TypeError: ('Params must be in a list, tuple, or Row', 'HY000')
- c# - 使用具有不同模型和 DataTemplates 的分组 ListView
- sql - 使用 DENSE_RANK() 将数据从行中提取到列中
- android - 无法禁用调试-AndroidManifest.xml
- spring-boot - 如何将“<”,“>”,“=”等运算符(小于,大于,等于)作为参数传递给springboot中的本机查询?