title: plot wavfile with python
body: <p>i would like to plot a wav file with python. This should show a sinus.</p>
  <p>This is my code so far:</p>
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  import wave
  import sys
  
  
  spf = wave.open(&quot;sin.wav&quot;, &quot;r&quot;)
  
  # Extract Raw Audio from Wav File
  signal = spf.readframes(-1)
  signal = np.fromstring(signal, np.int8)
  
  
  # If Stereo
  if spf.getnchannels() == 2:
      print(&quot;Just mono files&quot;)
      sys.exit(0)
  
  plt.figure(1)
  plt.title(&quot;Signal Wave...&quot;)
  plt.plot(signal)
  plt.show()
  </code></pre>
  <p>I got this Error: WAV header is invalid: nAvgBytesPerSec must equal product of nSamplesPerSec and nBlockAlign, but file has nSamplesPerSec = 16384, nBlockAlign = 1, and nAvgBytesPerSec = 44100</p>
  <p>Does anyone know how to get this working ?</p>