gpt4 book ai didi

python - 声音特征属性错误 : 'rmse'

转载 作者:行者123 更新时间:2023-12-02 22:13:34 27 4
gpt4 key购买 nike

在使用 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 之一.如果您查看 changelog0.7 ,您会注意到 rmse被弃用 rms .只需运行:

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

你应该没事的。

关于python - 声音特征属性错误 : 'rmse' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59027941/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com