• 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: extended80?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extended80?


  • Subject: Re: extended80?
  • From: Hidetomo Katsura <email@hidden>
  • Date: Mon, 7 Aug 2006 22:50:41 -0700

hi Paul,

i have my own AIFF write (no read) code (i didn't know about AudioFile stuff when i wrote it...) and according to my experiment on both ppc and i386, extened80 uses big-endian even on i386. that's probably because it's not one of C language native value types such as int, long, float, double, and you always need to treat it as struct. and you use x80tod() and dtox80() to convert it to a value.

MacTypes.h
Float80 80 bit MacOS float: 1 sign bit, 15 exponent bits, 1 integer bit, 63 fraction bits
typedef Float80 extended80;


fp.h
  extern double x80tod(const extended80 * x80);
  extern void dtox80(const double *x, extended80 *x80);

i'm not sure how you get "ND" in what type of variable but you are probably using a 16-bit variable somewhere accidentally.

  SoundDataChunk sound;  // CarbonCore/AIFF.h
  unsigned long ckID;
  bool isSoundData;

  sound.ckID = EndianU32_NtoB( SoundDataID );  // write
  ckID = EndianU32_BtoN( sound.ckID );  // read
  isSoundData = ( ckID == SoundDataID );

extened80 is supposed to be 80-bit (10-byte). as long as you use the types defined in CarbonCore/AIFF.h, it shouldn't get misaligned (or incorrectly aligned) when you read/write from/to chunk headers.

regards,
katsura

On Aug 7, 2006, at 10:16 PM, Paul Fredlein wrote:

Hi,

I'm attempting to parse, into a AudioBuffer, an aiff file which has been completely read into an NSData object. I'm having trouble making sense of the extended80 sample rate in the common chunk. How do I endian flip an extended80?

I also seem to be having trouble reading it as well as when I read the chunk type ID in the following sound data chunk I only get an "ND" instead of a "SNND". (extended80 seems to be 8 bytes but I thought it was supposed to be 10 bytes.) Is there something about byte alignment going on here?

I'm on an Intel iMac trying to make a universal binary.

Thanks,

Paul
_______________________________________________
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: extended80?
      • From: Hidetomo Katsura <email@hidden>
References: 
 >extended80? (From: Paul Fredlein <email@hidden>)

  • Prev by Date: Re: extended80?
  • Next by Date: Re: extended80?
  • Previous by thread: Re: extended80?
  • Next by thread: Re: extended80?
  • Index(es):
    • Date
    • Thread