title: Stereo to Mono wav in Python
body: <p>I am loading a wav with the scipy method wavefile.read() which gives me the samplerate and the audiodata</p>
  
  <p>I know that this audio data if stereo is stored as a multi-dimensional array such as </p>
  
  <pre><code>audiodata[[left right]
            [left right]
            ...
            [left right]]
  </code></pre>
  
  <p>I am then using this method to create a new array of mono audio data by taking (right+left)/2</p>
  
  <pre><code>def stereoToMono(audiodata)
      newaudiodata = []
  
      for i in range(len(audiodata)):
          d = (audiodata[i][0] + audiodata[i][1])/2
          newaudiodata.append(d)
  
      return np.array(newaudiodata, dtype='int16')
  </code></pre>
  
  <p>and then i write this to file using </p>
  
  <pre><code>wavfile.write(newfilename, sr, newaudiodata)
  </code></pre>
  
  <p>This is producing a Mono wav file, however the sound is dirty and has clickd etc throughout</p>
  
  <p>what am I doing wrong?</p>