AFGETFRAMECOUNT(3)
π AFGETFRAMECOUNT β bestie, let's get those numbers β¨
okay so this is the AFGETFRAMECOUNT(3) manual page, and she's here to give you three little functions that all do the same vibe: tell you the numbers about a track in your audio file. No cap. Let's go π«Ά
β¨ NAME β¨
afGetFrameCount, afGetTrackBytes, afGetDataOffset β get the total sample frame count, length of audio track in bytes, offset of the audio track for a track in an audio file π
πΈ SYNOPSIS πΈ
#include <audiofile.h>
AFframecount afGetFrameCount (AFfilehandle file, int track);
AFfileoffset afGetTrackBytes (AFfilehandle file, int track);
AFfileoffset afGetDataOffset (AFfilehandle file, int track);
like. three functions. same args. different gifts π
π PARAMETERS π
fileβ it's an audio file handle, and it has to come from a previous call toafOpenFile(3). don't just manifest one out of thin air, bestie, it doesn't work like that πtrackβ anintthat says which audio track insidefileyou're talking about. and here's the tea: all supported file formats contain exactly one audio track per file, so likeβ¦ you should always just use the constantAF_DEFAULT_TRACK. that's it. that's the one. periodt π
π¦ DESCRIPTION π¦
afGetFrameCount returns the total number of sample frames contained within the specified track of the specified file. iconic behaviour honestly.
and okay, what even is a sample frame, you ask? so each sample frame of audio consists of a fixed number of samples β and that number is equal to the number of audio channels in the track. for monaural data, a sample frame is just one audio sample. for stereophonic data, a sample frame is a whole stereo pair. it's giving duo. it's giving main character energy π§β¨
afGetTrackBytes returns the total number of bytes of raw audio data in the track β and yes, raw means prior to decompression or conversion. so that's the un-glow-up'd version, the before picture π
afGetDataOffset returns the offset in bytes of the start of the audio data contained within the specified track of the specified file. it's literally just "where does the audio start" energy π
π RETURN VALUE π
afGetFrameCountreturns the total number of sample frames in track. π’afGetTrackBytesreturns the total number of bytes of audio data in track. π¦afGetDataOffsetreturns the offset in bytes to the beginning of the audio data in track. π§
β οΈ and listen β each of these routines returns-1in case of error. so if you see a-1, that's not a vibe. that's a red flag. check your handle, check your track, do a vibe check fr fr ππ
π AUTHOR π
Michael Pruett <michael@68k.org> β king behaviour, thank you for your service π«‘π
and that's the whole page bestie!! this was Audio File Library 0.3.6, dated 03/06/2013 πβ¨ go forth and count your frames, you absolute icon πΈπ¦π
π¦ 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