title: Convert audio files for CMU Sphinx 4 input
body: <p>I have a big batch of files I'd like to run recognition on using CMU Sphinx 4. Sphinx requires the following format:</p>
  
  <ul>
  <li>16 khz</li>
  <li>16 bit</li>
  <li>mono</li>
  <li>little-endian</li>
  </ul>
  
  <p>My files are something like 44100 khz, 32 bit stereo mp3 files. I tried using Tritonus, and then its updated version JavaZoom, to convert using code from <a href="http://www.bakuzen.com/FileRecognizerForcedAlignment.java" rel="noreferrer">bakuzen</a>. However, <code>AudioSystem.getAudioInputStream(File)</code> throws an <code>UnsupportedAudioFileException</code>, and I haven't been able to figure out why, so I have moved on.</p>
  
  <p>Now I am trying ffmpeg. The command <code>ffmpeg -i input.mp3 -ac 1 -ab 16 -ar 16000 output.wav</code> seems like it should do the trick (except for little endian), but when I check the output with Audacity, it still labels it as "32-bit float". The command I found on <a href="http://wiki.roberttwomey.com/Solipsist_Development" rel="noreferrer">this site</a> also uses <code>-acodec pcm_s16le</code>, which from its name seems to be outputting 16 bit little endian; however, Audacity still tells me the output is <code>32 bit float</code>.</p>
  
  <p>Can anyone tell me how to convert audio files into the format required by CMU Sphinx 4?</p>