afSeekFrame(3dm)                                              afSeekFrame(3dm)


NAME
     afSeekFrame, afTellFrame - move logical file read pointer for a specified
     audio track to a desired sample frame location / retrieve current value
     of file read or write pointer.

SYNOPSIS
     #include <dmedia/audiofile.h>

     AFframecount afSeekFrame(const AFfilehandle file, int track,
                              AFframecount frameoffset)

     AFframecount afTellFrame(const AFfilehandle file, int track)

PARAMETER
     file     is an AFfilehandle structure, previously returned by
              afOpenFile(3dm), afOpenFD(3dm), or afOpenNamedFD(3dm).

     track    is an integer which identifies an audio track within a file
              which is open for read access.

              Since all currently supported file formats contain one audio
              track per file, the constant value AF_DEFAULT_TRACK should
              always be used here for now.

     frameoffset
              is a sample frame location of type AFframecount with a value
              between 0 and the total number of sample frames in the track
              minus one.  If frameoffset is set to -1, afSeekFrame() will
              return the current location in the file.

RETURN VALUE
     On successful completion, afSeekFrame() returns the new file pointer
     location measured in sample frames from the beginning of the audio track.
     afTellFrame() returns the current pointer location.  On an error, a
     negative value is returned.  The return type AFframecount is large enough
     to hold the maximum possible frame offset.

DESCRIPTION
     afSeekFrame() repositions the logical audio sample read pointer to offset
     sample frames from the beginning of the track. A call to
     afReadFrames(3dm) following a call afSeekFrame() will return sample data
     beginning at the updated file pointer location.  afTellFrame() is used to
     query the current value, and functions identically to the call
     afSeekFrame(file, AF_DEFAULT_TRACK, -1);

EXAMPLE
     To seek to the 10000th <left, right> sample pair in a stereo AIFF-C file,
     call afSeekFrame() with offset set to 10000.


SEE ALSO
     afOpenFile(3dm), afReadFrames(3dm), afSaveFilePosition(3dm)


                                                                        Page 2