title: Resample audio file from terminal
body: <p>I currently have a list of file for which I need to change the sample rate for. </p>
  
  <p>I'recently been aware that this is possible using <code>sox</code>  But when I try do it, I keep on getting a error message that  <code>sox wav: Premature EOF on .wav input file</code> And causes the audio file to be empty.. it seems like that sox is not able to resample an audio file which input = output... which I kinda need, if I have to convert a whole directory of audio files... </p>
  
  <p>Currently used commands:</p>
  
  <pre><code>~/kaldi-trunk/egs/yesno/s5_k_added$ sox 0_0_0_0_1_1_1_1.wav -r 8000 0_0_0_0_1_1_1_1.wav 
  sox WARN wav: Premature EOF on .wav input file
  :~/kaldi-trunk/egs/yesno/s5_k_added$ play 0_0_0_0_1_1_1_1.wav 
  
  0_0_0_0_1_1_1_1.wav:
  
   File Size: 44        
    Encoding: Signed PCM    
    Channels: 1 @ 16-bit   
  Samplerate: 8000Hz       
  Replaygain: off         
    Duration: unknown      
  
  In:0.00% 00:00:00.00 [00:00:00.00] Out:0     [      |      ]        Clip:0    
  Done.
  </code></pre>
  
  <p>How do I resample a directory of audio files? </p>