3 afGetFrameCount, afGetTrackBytes, afGetDataOffset - get the total sample
4 frame count, length of audio track in bytes, offset of the audio track for a
5 specified audio track in a specified AFfilehandle structure
10 #include <audiofile.h>
12 AFframecount afGetFrameCount (AFfilehandle file, int track);
14 AFfileoffset afGetTrackBytes (AFfilehandle file, int track);
16 AFfileoffset afGetDataOffset (AFfilehandle file, int track);
21 file is an AFfilehandle that has been created by a previous call to
24 track is an integer which specifies an audio track within file. All
25 supported file formats contain exactly one audio track per file, so the
26 constant AF_DEFAULT_TRACK should always be used.
31 afGetFrameCount returns the total number of sample frames contained
32 within the specified track of the specified file.
34 Each sample frame of audio consists of a fixed number of samples (equal to
35 the number of audio channels in the file, equal to the value returned by
36 afGetChannels for the particular track and file). For monaural data, a
37 sample frame consists of one audio sample. For stereophonic data, a sample
38 frame consists of a stereo pair.
40 afGetTrackBytes returns the total number of bytes of raw audio data
41 (i.e., prior to decompression) in track. This is useful for determining
42 raw file seek points, etc.
44 afGetDataOffset returns the offset in bytes of the start of the audio
45 data contained within the specified track of the specified file.
50 afGetFrameCount returns the total number of sample frames in track.
51 afGetTrackBytes() returns the total number of bytes of audio data in
52 track. afGetDataOffset() returns the offset in bytes to the beginning
53 of the audio data in track.
55 If an error occurs, -1 is returned by all of these routines.