Librosa和matplotlib音频识别

时间:2021-02-08 12:45:04   收藏:0   阅读:0

音频判断:librosa和 matplotlib

Librosa是音频识别的包

matplotlib是音频转图片可视化的包

命令下载:

pip install librosa -i https://mirrors.ustc.edu.cn/pypi/web/simple

pip install matplotlib -i https://mirrors.ustc.edu.cn/pypi/web/simple

 

# 2.判断音频是否有声音
#    Load the audio as a waveform `y`
#    Store the sampling rate as `sr`
y, sr = librosa.load(file_name_dir, sr=None)
plt.figure()
librosa.display.waveplot(y, sr)
plt.title(Beat wavform)
plt.savefig(Picture/{0}.png.format(name))
print(type(y))
plt.close(all)
            

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!