AFSETVIRTUALSAMPLEFO(3)
β¨ afSetVirtualByteOrder, afSetVirtualChannels, afSetVirtualPCMMapping, afSetVirtualSampleFormat β¨
okay so bestie, this is the afSetVirtual... crew from section 3 of the manual β four lil functions that all do the same iconic thing: they set the virtual data format for a track in an audio file. π not the real format, the virtual one. yes queen, they're different. iykyk.
πΈ SYNOPSIS πΈ
#include <audiofile.h>
int afSetVirtualByteOrder (AFfilehandle file, int track, int byteOrder);
int afSetVirtualChannels (AFfilehandle file, int track, int channels);
int afSetVirtualSampleFormat (AFfilehandle file, int track,
int sampleFormat, int sampleWidth);
int afSetVirtualPCMMapping (AFfilehandle file, int track,
double slope, double intercept, double minclip, double maxclip);
four functions, one header, zero drama. slay. π«Ά
π PARAMETERS π
here's the tea on every single argument, no skips, no skimming, fr fr:
fileis anAFfilehandlewhich refers to an open audio file, and it's usually created byafOpenFile. so like, you already opened it. the file is right there. πtrackis an integer which identifies a particular track in an open audio file. and babes, the only valid track isAF_DEFAULT_TRACKfor all currently supported file formats. that's it. that's the whole list. one (1) valid value. πsampleFormatis an integer which denotes a virtual sample format. valid values areAF_SAMPFMT_TWOSCOMP,AF_SAMPFMT_UNSIGNED,AF_SAMPFMT_FLOAT, andAF_SAMPFMT_DOUBLE. four options, pick your fighter. βsampleWidthis a positive integer which specifies the number of bits in a sample. positive! don't come in here with a negative number. πchannelsis a positive integer which specifies the number of interleaved audio channels in the given audio track. again: positive. we're being so real about that. π¦byteOrderis an integer which specifies the virtual byte order of samples in the given audio track.byteOrdercan be eitherAF_BYTEORDER_BIGENDIANorAF_BYTEORDER_LITTLEENDIAN. big endian or little endian, no in-between, no third thing. πslopeandinterceptare double-precision floating point values which indicate the audio data sample slope and zero-crossing value, respectively, for the given sample format. respectively!! slope = slope, intercept = zero-crossing. don't mix them up bestie. π§minclipandmaxclipare double-precision floating point values which indicates the minimum or maximum sample values to be returned. any values less thanminclipwill be set tominclip, and any values greater thanmaxclipwill be set tomaxclip. so it's a little clamping situation. values that stray too far get gently shoved back into the range. it's giving protective. π₯Ί
π RETURN VALUE π
these functions return 0 for success and -1 for failure. that's it. zero is the good one, negative one is the "we don't talk about it" one. no in-between, no fancy error codes, just vibes and a number. π₯
π AUTHOR π
Michael Pruett <michael@68k.org> β the main character who wrote this. we love him, we thank him, periodt. π
and that's the whole page, bestie!! π this was pulled from Audio File Library 0.3.6, dated 03/06/2013, and the manual page goes by AFSETVIRTUALSAMPLEFO(3) β okurrr, go forth and set those virtual formats. 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