The samplerate is the 4 bytes after the number of channels in the WAVE fmt chunk. Ref:
http://www.lightlink.com/tjweber/StripWav/Canon.html
AIFF:
The samplerate is the last field in the COMM (Common) chunk.
typedef struct {
ID ckID;
long ckSize;
short numChannels;
unsigned long numSampleFrames;
short sampleSize;
extended sampleRate;
} CommonChunk;