title: Decoding ima4 audio format
body: <p>To reduce the download size of an iPhone application I'm compressing some audio files.  Specifically I'm using afconvert on the command line to change .wav format to .caf format w/ ima4 compression.</p>
  
  <p>I've read <a href="http://www.wooji-juice.com/blog/iphone-openal-ima4-adpcm.html" rel="noreferrer">this</a> (wooji-juice.com) awesome post about this exact topic.  I'm having trouble w/ the "decoding ima4 packets" step.  I've looked at their sample code and I'm stuck.  Please help w/ some pseudo code or sample code that can guide me in the right direction.</p>
  
  <p>Thanks!</p>
  
  <p><strong>Additional info</strong>:
  Here is what I've completed and where I'm having trouble...
  I can play .wav files in both the simulator and on the phone.
  I can compress .wav files to .caf w/ ima4 compression using afconvert on the command line.  I'm using the SoundEngine that came w/ CrashLanding (I fixed one memory leak).
  I modified the SoundEngine code to look for the mFormatID 'ima4'.</p>
  
  <p>I don't understand the blog post linked above starting w/ "Calculating the size of the unpacked data".  Why do I need to do this?  Also, what does the term "packet" refer to?  I'm very new to any sort of audio programming.</p>