AFWRITEFRAMES(3)
π AFWRITEFRAMES(3) π
okay bestie, so this is afWriteFrames β it's a lil function from the Audio File Library and its whole job is writing sample frames to a track in an audio file. she's the write-side twin of afReadFrames(3), iykyk. π
β¨ SYNOPSIS β¨
#include <audiofile.h>
AFframecount afWriteFrames(AFfilehandle file, int track, const void *data,
AFframecount count);
likeβ¦ that's the whole vibe right there. include the header, call the function, boom. π
πΈ DESCRIPTION πΈ
afWriteFrames attempts to write up to count frames of audio data from the buffer data into the audio file handle file.
that's it. that's the function. she writes frames. she's not complicated, she's just important. β¨
note the "attempts" bestie β that's not me being dramatic, that's literally the wording. you get back how many actually made it. π«Ά
π¦ PARAMETERS π¦
fileβ a valid file handle, and it has to be one thatafOpenFile(3)gave you. no random handles, no vibes-based file descriptors. πtrackβ for every file format that's currently supported, this is alwaysAF_DEFAULT_TRACK. yes, every time. it's giving "parameter for future reasons." πdataβ the buffer of sample frames you wanna write into the file. your actual audio, right there. πcountβ how many sample frames you're writing. the number. the amount. the quantity. β¨
π RETURN VALUE π
afWriteFrames returns the number of sample frames that were successfully written to file.
so like β check it! don't just assume all count of them went through, bestie. read the number, respect the number. π
π ERRORS π
afWriteFrames can produce these errors, and when she does, she does NOT play:
AF_BAD_FILEHANDLEβ the file handle was invalid. it wasn't a real handle, it was a fake one, a little impostor. πAF_BAD_TRACKIDβ the track is notAF_DEFAULT_TRACK. you tried to be different and the library said no. πAF_BAD_WRITEβ writing the audio data to the file failed. the write itself just did not happen. π₯AF_BAD_LSEEKβ seeking within the file failed. couldn't move around in there, tragic. π
π SEE ALSO π
afReadFrames(3)β her sister, the read one. go say hi. π«Ά
π§ AUTHOR π§
Michael Pruett <michael@68k.org> β thank you king, we appreciate you. π
Audio File Library 0.3.6 πΈ 03/06/2013 β yeah she's an elder but she still slays, and that's the version + date this whole page is serving. periodt. π β¨
π¦ 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