Posted on

Audio Buffer Size as Explained by a Whale-Turtle-Octopus

The year was 1911, and in a showdown that must’ve inspired the knife fight between the Jets and Sharks (West Side Story, y’all), ten uber-rich businessmen challenged Harry Houdini to perform an incomprehensible death-defying escape from the belly of a whale.

Except apparently whales were hard to come by, so Houdini said “screw it, I’m escaping a whale-turtle-octopus instead!”  Keen observers noticed that the seabeast looked more like a giant leatherback turtle than a whale, but today nobody’s quite sure and there are varying accounts as to whether or not it was a whale, turtle, or an octopus-ish thing.

And lest you think I’m lying to you about this story, on September 26, 1911, Harry Houdini snuggled up with leg irons and handcuffs inside a sewn up whale-turtle-octopus carcass that was wrapped in chains.  Around 15 minutes later, a smiling Houdini emerged unscathed (though nearly having suffocated from the arsenic fumes used to embalming the creature) to a crowd uproar that couldn’t comprehend how he pulled it off.

Just like Houdini’s audience, we often swear that our DAWs do magic because some of its settings are incomprehensible to us.  We think “I dunno what that checkbox does, but it seems to work better when it’s checked… so I’m gonna leave it checked.”  One of the culprits of this is the “buffer size” option as made famous in Pro Tools’ Playback Engine window – we know it works better for reverbs when you make the buffer bigger, but we don’t know why.

So, let’s change that!

What is an audio buffer?

An “audio buffer” is just a collection of audio samples.  Because our DAW plays back audio in real time, it doesn’t load all the samples from all our channels at once.  Instead, it reads them in what programmers call blocks (That’s why, in Reaper, you’ll see a similar option defined as “block size” instead of “buffer size”).  In programming vernacular, these terms are kind of interchangeable – but usually we’re referring to an “audio buffer” that contains “blocks” of audio.

To put this in the most simple terms possible – when we hit spacebar to begin playback in our DAW, the DAW begins processing samples in extremely small chunks.  These small chunks go from memory (our RAM), to our plugins, to the DAW routing/mixer, and to our speakers at a crazy rapid pace (fast enough for your ears and brain to process this as sound waves).

Reading the data in small chunks is beneficial to us, because that’s what enables us to hear our effects processed and changed in real time (as opposed to “offline” – where the processing can happen faster, but you can’t hear it in real time).  When you think of these chunks, associate them with the words “block” and “buffer” in your head.

What does “buffer size” mean?

The buffer (or block) size is indicative of the number of samples the DAW passes around the system every time it processes.  As we know from doing our own recordings, the lower this size is, the less system latency there is.  But, if we increase this size, our more resource intensive plugins will perform better.

Why is that?  Simply because by increasing the buffer size, we’re telling the system to pass a larger chunk of samples around.  On one hand, this is more resource intensive.  On the other hand, this gives our computers plenty of data to chew on and is a more efficient use of processing power.  The inverse is true for when we’re recording live, because we’re usually doing less signal processing and want to hear as little delay as possible from the movement of our microphone’s physical diaphragm to when we hear those soundwaves back in our ears.  The least latency would involve us removing the computer altogether, of course!

Why does “buffer size” matter?

There’s always a balance between computational speed and latency.  Even though today’s computer systems can easily handle most multi-track recording and plugin setups we use at home (if you’re recording a giant ensemble, I’m sorry), it’s in our best interest to know what our DAWs terms mean and how to best use them to our advantage.

For those of us interested in plugin programming, or simply understanding how our DAW works better – this is a basic building block of how things work.  Though it appears that a playback head moves across our sessions one sample at a time, our DAW is actually reading (and writing) data in chunks.

What’s even more fun is that when we understand how this works, we can actually make other non-DAW programs work better as well.  If we, for example, play content off of a network (as many of us do from home now), VLC has the option for us to increase the buffer size for content you play over the network.  If you’ve ever experienced content stuttering when playing back over a network, sometimes increasing the playback buffer size will alleviate this.  Why?  Because we’re telling our computer to use more RAM to store more data of the thing we want to see or hear, and hopefully we won’t out of data in memory before our machine has to grab more!

“But Adaaam” you say, “this sounds complicated and there are numbers involved and it makes my brain hurt.”

That’s fine – you don’t need to have this terminology memorized to mix music, make games, and edit movies or podcasts.  But – I’d definitely argue that you should stretch yourself.  Understanding how to use our tools better makes us better creators!

Ok, how do buffers relate to whales again?

  • An audio buffer is a collection of audio samples
  • Our DAW passes these things around in chunks called “blocks” rather than reading everything at once
  • This system is what allows for realtime mixing and processing
  • None of this requires death-defying whale-turtle-octopus escapes

While we’re on the subject of audio buffers

I’m not sure if I’ve told you – but I’m working on audio plugins now!  I’m not quite ready to put what I’m working on in your hands, but I’ve been plucking at a delay/bitcrusher combo for a few months now.  It’s guaranteed to give you a trippy effect that sounds as if your track is melting in a sea of crushed bit goodness.

If you’d like to take a look, you can peek at it on my Instagram.  Soon, you’ll be able to download a copy of it for either Windows or Mac in VST, AU, and AAX formats!


Copyright 2016-2021, NIR LLC, all rights reserved.