afGetRate(3dm) afGetRate(3dm) NAME afGetRate, afGetVirtualRate - get the track/virtual sample rate for a specified audio track from an AFfilehandle structure SYNOPSIS #include <dmedia/audiofile.h> double afGetRate(AFfilehandle file, int track) double afGetVirtualRate(AFfilehandle file, int track) PARAMETER file is an AFfilehandle structure, previously created by a call to afOpenFile(3dm). track is an integer which identifies the audio track in the file. Since all currently supported file formats contain exactly 1 audio track per file, the value AF_DEFAULT_TRACK should always be used for this argument for now. RETURN VALUE afGetRate() returns a positive double-precision floating point value which specifies the audio sample rate in Hz of the data in track. afGetVirtualRate() returns a positive double-precision floating point value which specifies the virtual audio sampling rate in Hz of the data in track as set by a previous call to afSetVirtualRate(3dm). -1.0 is returned in case of error. DESCRIPTION afGetRate() and afGetVirtualRate() return, in Hz., the file and virtual sampling rates, respectively, of the data associated with the specified track in an audio file. The sampling rate is returned as a double- precision floating-point value. For example, a CD-quality audio track would return a sample rate value of 44100.0. CAVEATS afGetRate() may return any conceivable sampling rate. Programs should check that the sampling rate of a file opened for reading is a value it can deal with, or use the virtual rate setting to make it so. SEE ALSO afOpenFile(3dm), afInitRate(3dm), afSetVirtualRate(3dm) Page 1