afGetFrameCount(3dm) afGetFrameCount(3dm) NAME afGetFrameCount, AFgetframecnt, afGetTrackBytes, afGetDataOffset - get the total sample frame count / data bytes / data offset for a specified audio track from an AFfilehandle structure SYNOPSIS #include <dmedia/audiofile.h> AFframecount afGetFrameCount(AFfilehandle file, int track) AFfileoffset afGetTrackBytes(AFfilehandle file, int track) int afGetDataOffset(AFfilehandle file, int track) PARAMETER file is an AFfilehandle structure, previously created by a call to afOpenFile(3dm). track is an integer which identifies an audio track in file. Since all currently supported file formats contain exactly one audio track per file, the constant AF_DEFAULT_TRACK should always be used here. RETURN VALUE afGetFrameCount() returns the total number of sample frames in track. afGetTrackBytes() returns the total number of bytes of audio data in track. afGetDataOffset() returns the offset in bytes to the beginning of the audio data in track. In case of error, -1 is returned by all of these routines. DESCRIPTION an audio track in the file represented by the AFfilehandle argument. In general, each sample frame in a given track consists of n samples, where n is the value returned by afGetChannels(3dm) for track. For monaural data, a sample frame consists of a single audio sample. For stereo data, a sample frame consists of a <left, right> stereo sample pair. afGetTrackBytes() returns the total number of bytes of raw audio data (i.e., prior to decompression) in track. This is useful for determining raw file seek points, etc. The return types AFframecount and AFfileoffset are large enough to hold the maximum possible frame count value and maximum possible byte size, respectively, for the current file system. CAVEATS This routine may not function correctly if the user changes the file position on the file descriptor for the AFfilehandle being manipulated. See the section CAVEATS FOR USING THE HANDLE'S FILE DESCRIPTOR in afIntro(3dm) for some important information about how to deal with this situation. SEE ALSO afOpenFile(3dm), afWriteFrames(3dm), afReadFrames(3dm), afGetChannels(3dm). afGetVirtualChannels(3dm), afSetVirtualChannels(3dm) Page 2