Displaying levels of wav file <p>I want to read wav file and display levels of it. I know how to read frames, using wave module in python, but do not know what to deal with it. Any ideas will help. Thanks</p> <pre><code>import wave import struct import matplotlib.pyplot as plt wrd = wave.open("albatros.wav") display = [] display2=[] x = [] (nchannels, sampwidth, framerate, nframes, comptype, compname) = wrd.getparams() for i in range(0,int(nframes)): x.append(i) samplestring = wrd.readframes(1) display.append(struct.unpack('h',samplestring[:2])[0]); if(nchannels == 2): display2.append(struct.unpack('h',samplestring[2:4])[0]) plt.figure(1) plt.plot(x,display, 'k') if (nchannels == 2): plt.figure(2) plt.plot(x,display2, 'k') plt.show() print (len(display)) wrd.close() </code></pre>