home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!rutgers!psinntp!psinntp!iscnvx!enterprise!news
- From: merrick@aic.lockheed.com (Darrell Merrick)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: AIFF and 'extended' type
- Message-ID: <1992Aug18.155902.29962@enterprise.rdd.lmsc.lockheed.com>
- Date: 18 Aug 92 15:59:02 GMT
- Sender: news@enterprise.rdd.lmsc.lockheed.com
- Organization: Lockheed Artificial Intelligence Center
- Lines: 30
- Nntp-Posting-Host: philippines.rdd.lmsc.lockheed.com
-
- In article <1992Aug17.204116.11424@nosc.mil>, frantzen@nosc.mil (Louise E. Frantzen) writes:
- >
- > I have a question regarding the AIFF file format and the 'extended' type
- > which is used for the SampleRate. I am using THINK C 5.0. I have been
- > studying the info on AIFF in IM Vol VI and am stumped on this one. On
- > page 22-49 of IM VI, in listing 22-13, the hex value "400DADDD1745D145826B"
- > is given as "AIFFSampleRate (22kHz in extended type)". I have looked through
- > Types.h and do not understand how the above hex value translates into the
- > sample rate of 22254.5455 Hz. If anyone can give me some direction on how
- > to understand this or tell me what other documentation to look at I would
- > be very appreciative.
- >
-
- I usually try to avoid dealing with such data types (Fixed, extended, etc)
- directly and use conversion functions instead. For AIFF files you can define
- sampleRate as a long and use the Long2Fix function to convert it within the
- SetupAIFFHeader call (the SetupAIFFHeader function is looking for a sample
- rate of type Fixed):
-
- #include <SoundInput.h>
- #include <AIFF.h>
- #include <FixMath.h>
-
- long sampleRate = 44100;
- oSError = SetupAIFFHeader(file, numChannels, Long2Fix(sampleRate), sampleSize, NoneType,
- soundSize, numFrames);
-
-
- Also, if you want to know the low-level details of handling extended and Fixed data
- types, the Apple Numerics manual covers such things.
-