| 1 |
afSeekFrame(3) |
| 2 |
============== |
| 3 |
|
| 4 |
NAME |
| 5 |
---- |
| 6 |
afSeekFrame, afTellFrame - update or access the current sample frame |
| 7 |
position for a track in an audio file |
| 8 |
|
| 9 |
SYNOPSIS |
| 10 |
-------- |
| 11 |
#include <audiofile.h> |
| 12 |
|
| 13 |
AFframecount afSeekFrame(AFfilehandle file, int track, |
| 14 |
AFframecount frameOffset); |
| 15 |
|
| 16 |
AFframecount afTellFrame(AFfilehandle file, int track); |
| 17 |
|
| 18 |
PARAMETERS |
| 19 |
---------- |
| 20 |
'file' is a valid audio file handle created by linkaf:afOpenFile[3]. |
| 21 |
|
| 22 |
'track' identifies an audio track within the file. `track` is always |
| 23 |
`AF_DEFAULT_TRACK` for all currently supported audio file formats. |
| 24 |
|
| 25 |
'frameOffset' is a sample frame offset. Valid sample frame offsets must |
| 26 |
be greater than or equal to zero and strictly less than the number of |
| 27 |
sample frames contained within the specified audio track. The special |
| 28 |
value `-1` is also allowed. |
| 29 |
|
| 30 |
DESCRIPTION |
| 31 |
----------- |
| 32 |
`afSeekFrame` moves the logical file position for a specified audio |
| 33 |
track to a desired sample frame location. If `frameOffset` is `-1`, |
| 34 |
`afSeekFrame` will not modify the current file offset and will instead |
| 35 |
return the current file position. |
| 36 |
|
| 37 |
`afTellFrame` returns current file position in sample frames. |
| 38 |
|
| 39 |
RETURN VALUE |
| 40 |
------------ |
| 41 |
On success, `afSeekFrame` and `afTellFrame` will return the current file |
| 42 |
position as measured in sample frames from the start of the audio |
| 43 |
track. On failure, `afSeekFrame` and `afTellFrame` will return the value |
| 44 |
`-1`. |
| 45 |
|
| 46 |
ERRORS |
| 47 |
------ |
| 48 |
The following errors can be generated by `afSeekFrame` or `afTellFrame`: |
| 49 |
|
| 50 |
`AF_BAD_FILEHANDLE`:: `file` does not represent a valid file handle. |
| 51 |
`AF_BAD_TRACK`:: `track` does not identify a valid track. |
| 52 |
`AF_BAD_LSEEK`:: A call to `lseek` failed. |
| 53 |
|
| 54 |
AUTHOR |
| 55 |
------ |
| 56 |
Michael Pruett <[email protected]> |