Fork me on GitHub

  python 中,常用的有两种可以读取wav音频格式的方法,如下所示:

 1 import scipy
 2 from scipy.io import wavfile
 3 
 4 import soundfile as sf
 5 
 6 fs,data = wavfile.read("stop.wav")
 7 print("sample:%d" % fs)
 8 print(data)
 9 
10 
11 data_sf, sample_rate = sf.read('stop.wav')
12 
13 print("sound sample:%d" % sample_rate)
14 print(data_sf)

 

posted on 2018-10-15 13:36  虚生  阅读(5663)  评论(0编辑  收藏  举报