|Jan 15, 2009, 05:18 PM||#1|
Converting a number to IEEE Extended
I'm trying to read/write sample rate information from AIFF files and came across these two handy functions for converting to/from IEEE 80-bit Extended number format;
However, when I use the function the numbers don't come out right. For example, the bytes for a 44100Hz sample is (if you read it in a hex editor);
40 0D AC 44 00 00 00 00 00 00
ConvertToIeeeExtended((double)44100, (char *)byteBuffer);
40 0E AC 44 00 00 00 00 00 00
Or alternatively, is there a way of working with IEEE 80-bit Extended numbers in the iPhone API?
|Jan 15, 2009, 06:17 PM||#2|
Might have answered my own question. If you use a "double long" you can use a (char *) to access the first 10 bytes and it gives you the correct result, in reverse order.
As for the "error" I was seeing, it was in fact correct (so the function I found and linked to actually works too) - for some reason the audio properties of the file were being reported incorrectly in the sound editor I was using. Doh!
Last edited by neil.b; Jan 15, 2009 at 07:15 PM. Reason: Missed a bit
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Carrier: VZW - Ported number from Sprint - won't work when "Extended"/Roaming||fireman949||iPhone Tips, Help and Troubleshooting||6||Oct 5, 2013 02:44 AM|
|Your Apple store order number is also your UPS reference number||Gjwilly||iPhone||0||Sep 23, 2013 10:36 AM|
|802.11ac Routers Prior to Finalization of IEEE Standard?||xlr8or||Mac Peripherals||1||Aug 30, 2013 11:22 AM|
|4S- Changed phone number, old number still shows up in messages||dbabytro||iPhone||4||Jul 18, 2013 02:58 PM|
|Serial number or phone number?||davidra||iPhone Tips, Help and Troubleshooting||1||Mar 13, 2013 11:04 PM|
All times are GMT -5. The time now is 04:48 PM.