title: Audio: Converting between M4A and FLAC, WAV, or raw
body: <p>I'm working with audio recorded via Quicktime and saved in .m4a format. I'd like to use Google Cloud Provider's Speech API and their recommendations are:</p>
  
  <p><strong>Do:</strong></p>
  
  <blockquote>
    <p>Use a lossless codec to record and transmit audio. FLAC or LINEAR16 is recommended.   </p>
  </blockquote>
  
  <p><strong>Avoid:</strong></p>
  
  <blockquote>
    <p>Using mp3, mp4, m4a, mu-law, a-law or other lossy codecs during recording or transmission may reduce accuracy. If your audio is already in an encoding not supported by the API, transcode it to lossless FLAC or LINEAR16. If your application must use a lossy codec to conserve bandwidth, we recommend the AMR_WB, OGG_OPUS or SPEEX_WITH_HEADER_BYTE codecs, in that preferred order.</p>
  </blockquote>
  
  <p>Source: <a href="https://cloud.google.com/speech/docs/best-practices" rel="noreferrer">https://cloud.google.com/speech/docs/best-practices</a></p>
  
  <p>The API supports FLAC, WAV, or raw and I'm trying to transcode my file into one of these programmatically for use in an application. However, I'm unable to find a good Python library to do this.</p>
  
  <p>UPDATE:
  Here's the answer: <a href="https://www.ffmpeg.org/" rel="noreferrer">https://www.ffmpeg.org/</a> (not python, but for sure the most comprehensive tool out there)</p>