title: Crackling sound when recording audio with ffmpeg
body: <p>I'm trying to record from a microphone and webcam on <strong>MacOS</strong> with the following command:</p>
  <p><code>ffmpeg -f avfoundation -framerate 30 -i &quot;0:0&quot; ~/recorded.mp4</code></p>
  <p>My result has crackling in the audio.</p>
  <p>I'm familiar with this problem when you use a <a href="https://en.wikipedia.org/wiki/Digital_audio_workstation" rel="nofollow noreferrer">DAW</a>: you solve it by increasing the sample buffer. The idea is that audio samples coming from your interface/mic are not coming in a consistent or fast enough rate, so the missing samples being filled with zeroes causes the crackling sound. To avoid missing samples you want the recording software to wait longer for samples accumulating in a buffer before they're processed.</p>
  <p>How can you configure such buffer for <code>ffmpeg</code>?</p>