title: Unpacking 3-byte/24-bit data chunks with Ruby
body: <p>I am building a pure-Ruby WAV file read/write library, learning deeper Ruby functionality as I go. It currently works well with 16-bit audio, as I am able to use <code>String.unpack('s*')</code> to pull individual audio samples out into an array of signed integers. I am having trouble wrapping my mind around how to go about dealing with 24-bit audio, however. Each sample in that case is 3 bytes long. What pack/unpack string would you recommend in that case, and would I likely have to drastically alter my approach (using padding or something like that)?</p>