title: Execute "ffmpeg" command in a loop
body: <p>I have three <code>.wav</code> files in my folder and I want to convert them into <code>.mp3</code> with ffmpeg.</p>
  <p>I wrote this bash script, but when I execute it, only the first one is converted to mp3.</p>
  <p>What should I do to make script keep going through my files?</p>
  <p>This is the script:</p>
  <pre><code>#!/bin/bash
  find . -name '*.wav' | while read f; do
      ffmpeg -i &quot;$f&quot; -ab 320k -ac 2 &quot;${f%.*}.mp3&quot;
  done
  </code></pre>