Extended 80-bit hex floating point (IEEE?) conversion

stephen barncard stephenREVOLUTION2 at barncard.com
Fri Feb 4 22:01:40 EST 2011


Still messing with exporting sounds out of Livecode. Working with AIF
files for now.

I can't yet find where Livecode stores the metadata like length,
sample rate and bit depth for imported sound files.

In the meantime, I can grab these values from the incoming aif files
and store them in custom properties ins the soundclip object.

The aiff sample rate is defined in 10 hex bytes of Extended 80-bit
floating point, like so: (big endian)

44100  =

40 0E AC 44 00 00 00 00 00 00 <http://www.onicos.com/staff/iz/formats/ieee.c>

48000   =

40 0E BB 80 00 00 00 00 00 00 <http://www.onicos.com/staff/iz/formats/ieee.c>

96000   =

40 0F BB 80 00 00 00 00 00 00
 <http://www.onicos.com/staff/iz/formats/ieee.c>

Extended 80-bit floating-point format
<http://www.onicos.com/staff/iz/formats/ieee.c>


I could use some help here.. I want to detect other sample rates. The ones
above were determined by examining them in sound files with known rates.

How would I convert these 80 bit hex floating point numbers to the values
shown and back again?. Baseconvert doesn't work with this many hex
characters. (linked is some C source...)
surely this can be done in Livecode...

thanks in advance...

-- 

-- 



Stephen Barncard
San Francisco Ca. USA

more about sqb  <http://www.google.com/profiles/sbarncar>



More information about the use-livecode mailing list