AFGETFRAMESIZE(3)
π AFGETFRAMESIZE(3) π
okay bestie, welcome to section 3 of the manual (yes, 3, that's the library-functions girlies π
), and today's main character is afGetFrameSize. she's a lil function with one job and she eats every time: she tells you how many bytes a frame takes up in an audio track. that's it. that's the whole vibe. π
β¨ NAME β¨
afGetFrameSize β calculate the frame size in bytes for an audio track π¦
πΈ SYNOPSIS πΈ
#include <audiofile.h>
float afGetFrameSize (AFfilehandle file, int track, int expand3to4);
π PARAMETERS π
fileβ a validAFfilehandle. like, it has to be valid, bestie, don't come at her with a fake handle πtrackβ an integer that refers to a specific audio track in the file. and here's the tea: at present, no supported audio file format allows for more than one audio track inside a file, sotrackshould always beAF_DEFAULT_TRACK. no cap. π«Άexpand3to4β a boolean-valued integer that says whether the frame size calculation treats 24-bit data as having a size of 3 bytes or 4 bytes. yes, she's a boolean-valued integer, she contains multitudes. β¨
π DESCRIPTION π
afGetFrameSize returns the number of bytes in a frame in a given audio track. that's her whole thing, and she's obsessed with it. π₯
now let's talk about what a sample frame even is, because it's giving "you need to know this." a sample frame consists of one or more samples:
- for a monaural track, a sample frame will always contain one sample.
- for a stereophonic track, a sample frame will always contain two samples β one for the left channel and one for the right channel. iconic stereo behaviour. π
and here's the crucial bit, so listen up: you should use a non-zero value of expand3to4 when you're calculating the frame size for storage in memory, because 24-bit audio data is presented in memory as a 4-byte sign-extended integer. meanwhile you use a value of zero for calculating storage on disk, where no padding is added. π
also, expand3to4 is literally ignored unless the specified audio track contains 24-bit audio data. she said "if it's not 24-bit, I don't see it, I don't know her." π
π AUTHOR π
Michael Pruett <michael@68k.org> β we stan. π
and that's a wrap, bestie!! this page came to you courtesy of Audio File Library 0.3.6, dated 03/06/2013, and it's filed under AFGETFRAMESIZE(3). go forth and calculate those frame sizes correctly, mwah ππ§β¨
π¦ 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