• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Resources to learn more about the difference between packed and unpacked (high/low aligned) samples?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resources to learn more about the difference between packed and unpacked (high/low aligned) samples?


  • Subject: Re: Resources to learn more about the difference between packed and unpacked (high/low aligned) samples?
  • From: Paul Davis <email@hidden>
  • Date: Mon, 12 May 2014 07:47:23 -0400

This is 32 bits:

     11111111111111111111111111111111

This is 32 bits with 8 bits set to zero


    00000000111111111111111111111111

This is 32 bits with a different 8 bits set to zero


    11111111111111111111111100000000

In the last two examples, there are 24 bits set to 1. You could consider that as a 24 bit audio sample packed into a 32 bit integer. But the two cases are very different. One of them is "low aligned" and one of them is "high aligned".

Audio interfaces don't produce more than 24 bits of data (even the ones that say they produce 24 typically don't actually get that close. If they really did generate 32 bits, the least significant bits would fluctuate with brownian noise (atomic motion). But computers like 32 bit chunks of data. So the interface will typically pack the 24 bit sample into a 32 bit chunk, which means that it has to leave 8 bits unset (or maybe not .... but that is another story).

Which 8 bits it leaves unset defines whether the format is "high aligned" or "low aligned". Note that this intersects just a little with the endianness of the processors in use. In general you don't have to think about it, except for the occasional wierd case where your interface's processor(s) and the CPU have different endianess. This has always been exceedingly rare and almost never happens these days.



On Mon, May 12, 2014 at 6:08 AM, Reed Weichler <email@hidden> wrote:
I'm looking at the documentation for AudioStreamBasicDescription's possible values for mFormatFlags here: https://developer.apple.com/library/mac/documentation/musicaudio/reference/CoreAudioDataTypesRef/Reference/reference.html#//apple_ref/doc/constant_group/Audio_Data_Format_Identifiers

I understand what most of the flags mean, namely float vs sint vs. uint, interleaved vs noninterleaved, and big endian vs little endian. But the one that's stumping me completely is what packed, high-aligned and low-aligned samples are. Could someone be kind enough to explain this to me, or provide a link to some sort of documentation on this? I have no idea what they are or could possibly mean. The documentation doesn't elaborate on it and I can't find anything on Google.

Thanks much.

Reed Weichler

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Resources to learn more about the difference between packed and unpacked (high/low aligned) samples?
      • From: Reed Weichler <email@hidden>
References: 
 >Resources to learn more about the difference between packed and unpacked (high/low aligned) samples? (From: Reed Weichler <email@hidden>)

  • Prev by Date: Resources to learn more about the difference between packed and unpacked (high/low aligned) samples?
  • Next by Date: Fwd: Report level in AudioUnit to parameter
  • Previous by thread: Resources to learn more about the difference between packed and unpacked (high/low aligned) samples?
  • Next by thread: Re: Resources to learn more about the difference between packed and unpacked (high/low aligned) samples?
  • Index(es):
    • Date
    • Thread