title: Convert PCM WAV to normal WAV in python
body: <p>I was using speech_recognition with a wav file that pjsua recorded, and it always ends with an error msg when I try to send the content of the file.</p>
  <p><code>Audio file could not be read as PCM WAV, AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another format</code></p>
  <p>The file plays normally using MPV, and inspecting the file show that it's a PCM (I used the file command).</p>
  <p><code>test2.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 16000 Hz</code></p>
  <p>Looking up, I found a guy with a similar <a href="https://stackoverflow.com/questions/16111038/how-to-convert-pcm-files-to-wav-files-scripting">problem</a>, the proposed solution (change a few parameters using the wave library) did not work out to me. After I use the <code>wav.setparams((2, 2, 44100, 0, 'NONE', 'NONE'))</code> the audio became complete garbage, like ant's talking.</p>
  <p>I really don't understand enough about sound files to understand what the &quot;channels&quot;, &quot;sampwidth&quot;, &quot;framerate&quot;, &quot;nframes&quot;, &quot;comptype&quot; and &quot;compname&quot; means...</p>