Python音频处理学习笔记(未完)

Python处理音频

完全Python新手,连输出语句print都不会的初心者

文章参考了

前期准备

  • 安装依赖库 numpy matplotlib scipy
pip install numpy matplotlib scipy

python处理音频

读取wav文件

#需要先引入音频处理的包
from pylab import*
from scipy.io import wavfile
#读取wav文件,wavfile读进来是一个int16或者int32的数组
sampFreq, snd = wavfile.read('440_sine.wav')#返回采样率sampFreq,已经音频数组snd

snd中的每个数据就是每次采样的音频值。处理音频即对snd数据进行对应的计算。

wav文件有一些属性

snd.dtype # 编码格式
snd.shape #采样点数 和 通道数

猜你喜欢

转载自blog.csdn.net/lucifly/article/details/54580869
今日推荐