import wave wav wave open wav mode nchannels sampwidth framerate nfram

1
2
3
4
5
6
7
import wave
wav = wave.open('1.wav', mode= "r")
(nchannels, sampwidth, framerate, nframes, comptype, compname) = wav.getparams()
content = wav.readframes(nframes)
print content
s = content.encode()
s.from_bytes(s, 'big')