AFSEEKFRAME(3)
β¨ AFSEEKFRAME(3) β¨
okay bestie, welcome to the Audio File Library manual, section 3 π this one's about afSeekFrame and afTellFrame, which are literally the vibe-check functions for where am I in this audio track rn π
π¦ NAME π¦
afSeekFrame, afTellFrame β update or access the current sample frame position for a track in an audio file
no cap, that's the whole thing. one moves you, one tells you where you are. iconic duo behavior fr fr π
πΈ SYNOPSIS πΈ
#include <audiofile.h>
AFframecount afSeekFrame(AFfilehandle file, int track,
AFframecount frameOffset);
AFframecount afTellFrame(AFfilehandle file, int track);
yes, you do need that #include <audiofile.h>, don't skip it π
π PARAMETERS π
fileβ bestie this has to be a valid audio file handle, the kind you got fromafOpenFile(3). no random ints, we're not doing that today πtrackβ tells us which audio track inside the file we're talking about. and listen:trackis alwaysAF_DEFAULT_TRACKfor all currently supported audio file formats. that's it, that's the whole menu πframeOffsetβ a sample frame offset. valid ones have to be greater than or equal to zero and strictly less than the number of sample frames in the specified audio track. so like, zero is fine, the last frame is fine, but the count itself? not fine. and the special value-1is also allowed, which we'll get into π
β¨ DESCRIPTION β¨
afSeekFrame moves the logical file position for a specified audio track to a desired sample frame location. it's giving teleportation but for audio files π§
but here's the fun part: if frameOffset is -1, afSeekFrame will not modify the current file offset and will instead return the current file position. so -1 is like... the "actually never mind, where was I?" option π
afTellFrame returns the current file position in sample frames. that's it. that's the function. it just tells you. main character energy, honestly π
π₯ RETURN VALUE π₯
on success, afSeekFrame and afTellFrame will return the current file position as measured in sample frames from the start of the audio track β
on failure, afSeekFrame and afTellFrame will return the value -1 π
ok so heads up:-1is BOTH a validframeOffsetargument AND the failure return value. do not let that trip you up bestie, check your errors π
π ERRORS π
the following errors can be generated by afSeekFrame or afTellFrame:
AF_BAD_FILEHANDLEβfiledoes not represent a valid file handle. (your handle is fake, girl, we can't work with this π«)AF_BAD_TRACKβtrackdoes not identify a valid track. πAF_BAD_LSEEKβ a call tolseekfailed. the underlying seek said nope π
π AUTHOR π
Michael Pruett <michael@68k.org>
we stan π«Ά
and that's the whole page bestie!! this was the AFSEEKFRAME(3) entry from the Audio File Library 0.3.6 man pages, dated 03/06/2013. go forth and seek responsibly πβ¨π
π¦ where this page comes from
- alpine 3.24: audiofile-doc 0.3.6-r3 Β· LGPL-2.1-or-later
- arch rolling: audiofile 0.3.6-12 Β· Apache-2.0 AND GPL-2.0-or-later AND LGPL-2.1-or-later
- debian bookworm: libaudiofile-dev 0.3.6-5+deb12u1 Β· LGPL-2.1-or-later
- debian trixie: libaudiofile-dev 0.3.6-7+b1 Β· LGPL-2.1-or-later
- epel 10: audiofile-devel 1:0.3.6-44.el10_2 Β· LGPL-2.1-or-later and GPL-2.0-or-later
- epel 9: audiofile-devel 1:0.3.6-36.el9 Β· LGPL-2.1-or-later and GPL-2.0-or-later
- fedora 43: audiofile-devel 1:0.3.6-42.fc43 Β· LGPL-2.1-or-later and GPL-2.0-or-later
- fedora 43: audiofile-devel 1:0.3.6-42.fc43 Β· LGPL-2.1-or-later and GPL-2.0-or-later
- fedora 44: audiofile-devel 1:0.3.6-44.fc44 Β· LGPL-2.1-or-later and GPL-2.0-or-later
- fedora 44: audiofile-devel 1:0.3.6-44.fc44 Β· LGPL-2.1-or-later and GPL-2.0-or-later
- nixpkgs unstable: audiofile 0.3.6
- opensuse-leap 16.0: audiofile-doc 0.3.6-bp160.1.13 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: audiofile-doc 0.3.6-bp160.1.13 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: audiofile-doc 0.3.6-bp160.1.13 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: audiofile-doc 0.3.6-bp160.1.13 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- ubuntu jammy: libaudiofile-dev 0.3.6-5+deb10u1build0.22.04.1 Β· LGPL-2.1-or-later
- ubuntu jammy: libaudiofile-dev 0.3.6-5build1 Β· LGPL-2.1-or-later
- ubuntu noble: libaudiofile-dev 0.3.6-6build2 Β· LGPL-2.1-or-later
- ubuntu questing: libaudiofile-dev 0.3.6-7build1
- ubuntu resolute: libaudiofile-dev 0.3.6-7build2 Β· LGPL-2.1-or-later
- ubuntu stonking: libaudiofile-dev 0.3.6-7build2 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms