【发布时间】:2020-07-25 17:33:17
【问题描述】:
我正在尝试使用librosa.display.waveplot(y,sr) 绘制音频文件
我的代码:
import librosa.display
ax1 = plt.subplot(gs[1])
y, sr = librosa.load("Audiofilepath")
ax1.plot(librosa.display.waveplot(y, sr))
我得到了绘制的结果。即使我收到以下错误消息
TypeError: float() argument must be a string or a number, not 'PolyCollection'
我在 StackOverflow 中使用上述错误消息进行了探索,结果可用于 numbers, period, nanType。但不适用于PolyCollection。
如果有librosa绘图的专家,请指导我避免此错误。
【问题讨论】:
标签: python-3.x matplotlib audio librosa