title: Python 3.7 Error When Using Wavefile to Read a .wav File
body: <p>I'm very new to using python, and I encountered an error when trying to fix a problem with some of my code. The code analyzes the frequency of sound and compares it to gunshots, but I keep getting an error. Unfortunately, I was not able to fix it on my own, although I spent several hours trying to do so. </p>
  
  <p>This is the problematic part of my code:</p>
  
  <pre><code>import wave    
  from wave import *
  import scipy
  from scipy import *
  from scipy.io import wavfile as wav
  import os
  from os import *
  
  os.path.join('/Users/TheBigApple/Downloads/make_call.py', '/Users/TheBigApple/Downloads/gun-gunshot-01.wav')
  os.path.join('/Users/TheBigApple/Downloads/make_call.py', '/Users/TheBigApple/Downloads/machine-gun-02.wav')
  os.path.join('/Users/TheBigApple/Downloads/make_call.py', '/Users/TheBigApple/Downloads/machine-gun-01.wav')
  os.path.join('/Users/TheBigApple/Downloads/make_call.py', '/Users/TheBigApple/Downloads/Prepared SFX Library/1911/A_34P.wav')
  os.path.join('/Users/TheBigApple/Downloads/make_call.py', '/Users/TheBigApple/output.wav') 
  
  
  CHUNK = 1087
  FORMAT = pyaudio.paInt16
  CHANNELS = 1
  WAVE_OUTPUT_FILENAME = "output.wav"
  RATE = 2000
  RECORD_SECONDS = 10
  p = pyaudio.PyAudio()
  wf = wave.open("output.wav", 'wb')
  stream = p.open(format=FORMAT,
                  channels=CHANNELS,
                  rate=RATE,
                  input=True,
                  frames_per_buffer=CHUNK,
                  output=True)
  frames = []
  
  for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):
      data = stream.read(CHUNK)
  frames.append(data)
  
  data = scipy.io.wavfile.read("output.wav")
  
  wf.setnchannels(1)
  wf.setsampwidth(p.get_sample_size(FORMAT))
  wf.setframerate(RATE)
  wf.close()
  </code></pre>
  
  <p>On this line:</p>
  
  <pre><code>    data = scipy.io.wavfile.read('output.wav'):
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>/Users/TheBigApple/PycharmProjects/untitled1/venv/bin/python /Users/TheBigApple/Downloads/make_call.py
  Traceback (most recent call last):
    File "/Users/TheBigApple/Downloads/make_call.py", line 206, in &lt;module&gt;
      data = scipy.io.wavfile.read("output.wav")
    File "/Users/TheBigApple/PycharmProjects/untitled1/venv/lib/python3.7/site-packages/scipy/io/wavfile.py", line 236, in read
      file_size, is_big_endian = _read_riff_chunk(fid)
    File "/Users/TheBigApple/PycharmProjects/untitled1/venv/lib/python3.7/site-packages/scipy/io/wavfile.py", line 168, in _read_riff_chunk
      "understood.".format(repr(str1)))
  ValueError: File format b''... not understood.
  
  Process finished with exit code 1
  </code></pre>