AFREADFRAMES(3)
π AFREADFRAMES β bestie, it's giving "gimme those audio frames" π
okay so real talk, you're in the AFREADFRAMES(3) zone, the audio-file-library part of the manual, and this one is literally just "read me some sample frames from a track, pls and thank you." π Let's go.
β¨ NAME β¨
afReadFrames β read sample frames from a track in an audio file π§
β¨ SYNOPSIS β¨
#include <audiofile.h>
AFframecount afReadFrames(AFfilehandle file, int track, void *data,
int count);
β¨ DESCRIPTION β¨
So afReadFrames is gonna attempt to read up to count frames of audio data β yes, up to, that's the vibe, no promises β out of the audio file handle file and straight into the buffer sitting at data. π«Ά
β¨ PARAMETERS β¨
fileβ a valid file handle, like the onesafOpenFile(3)hands you. If it's not valid, we're gonna have a problem (see ERRORS, bestie π).trackβ alwaysAF_DEFAULT_TRACKfor literally every file format currently supported. That's it. That's the whole range of options. πdataβ a buffer that storescountframes of audio sample data. It's where the frames land. πͺcountβ the number of sample frames you wanna read.
β¨ RETURN VALUE β¨
afReadFrames returns the number of frames it successfully read from file. So like, check it, because it might be fewer than you asked for. π
β¨ ERRORS β¨
when it goes wrong, it goes wrong like this:
AF_BAD_FILEHANDLEβ the file handle was invalid. not the file handle being mid, the file handle being invalid, there's a difference. πAF_BAD_TRACKIDβ thetrackparameter is notAF_DEFAULT_TRACK. girl, it's alwaysAF_DEFAULT_TRACK, we talked about this. πAF_BAD_READβ reading the audio data from the file failed. the read simply did not eat. πAF_BAD_LSEEKβ seeking within the file failed. the cursor said "no thank u." π
β¨ SEE ALSO β¨
afWriteFrames(3) β the other half of the story, the one where you write frames instead. π
β¨ AUTHOR β¨
Michael Pruett <michael@68k.org> β the icon, the legend, the main character who wrote this. π
and that's the whole page, no cap. this was Audio File Library 0.3.6, dated 03/06/2013, page AFREADFRAMES(3) β ty for coming to my ted talk, go read some frames bestie πβ¨π¦
π¦ 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