title: How to convert a 24-bit wav file to 16 or 32 bit files in python3
body: <p>I am trying to make spectrogram's of a bunch of .wav files so I can further analyze them(in python 3.6), however, I keep getting this nasty error</p>
  
  <pre><code> ValueError: Unsupported bit depth: the wav file has 24-bit data.
  </code></pre>
  
  <p>I have looked into other stack overflow posts such as 
  <a href="https://stackoverflow.com/questions/16767248/how-do-i-write-a-24-bit-wav-file-in-python">How do I write a 24-bit WAV file in Python?</a>
  but theses didn't solve the issue!</p>
  
  <p>I found a audio library called Pysoundfile</p>
  
  <p><a href="http://pysoundfile.readthedocs.io/en/0.9.0/" rel="noreferrer">http://pysoundfile.readthedocs.io/en/0.9.0/</a></p>
  
  <p>I installed it with </p>
  
  <pre><code>pip3 install pysoundfile
  </code></pre>
  
  <p>I have looked over the documentation and it is still not clear to me how to convert a 24-bit .wav file to a 32-bit wav file or a 16-bit wav file so that I can create a spectrogram from it. </p>
  
  <p>Any help would be appreciated!</p>