Librosa和matplotlib音频识别

音频判断: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')
            

 

posted @ 2021-02-07 19:40  是超级可爱的小姚童鞋  阅读(104)  评论(0编辑  收藏  举报