AFQUERY(3)
π NAME π
okay so bestie, this is the AFQUERY(3) page β it's all about afQuery, afQueryLong, afQueryDouble and afQueryPointer, the little squad whose whole job is querying the capabilities of the Audio File Library. no cap, they're literally the vibe check for what the library can and can't do. β¨
π¦ SYNOPSIS π¦
#include <audiofile.h>
AUpvlist afQuery (int querytype, int arg1, int arg2, int arg3, int arg4);
long afQueryLong (int querytype, int arg1, int arg2, int arg3, int arg4);
double afQueryDouble (int querytype, int arg1, int arg2, int arg3,
int arg4);
void *afQueryPointer (int querytype, int arg1, int arg2, int arg3,
int arg4);
π PARAMETERS π
so querytype is the main character here, and it can be exactly one of these icons:
AF_QUERYTYPE_FILEFMTAF_QUERYTYPE_INSTAF_QUERYTYPE_INSTPARAMAF_QUERYTYPE_COMPRESSIONAF_QUERYTYPE_COMPRESSIONPARAMAF_QUERYTYPE_MISCAF_QUERYTYPE_MARKAF_QUERYTYPE_LOOP
and then arg1, arg2, arg3 and arg4 are integer selectors whose whole meaning depends on whichever querytype you picked. they're like the plus-ones β they only make sense in context, fr fr. π
β RETURN VALUE β
when it goes well, afQuery hands you back a non-null AUpvlist value. slay. when it goes badly, afQuery returns null, while afQueryLong and afQueryDouble return -1 and afQueryPointer returns null. it's giving rejection. π
okay and this part MATTERS, bestie: pointers that represent character strings are owned by the Audio File Library and must not be freed. all other pointer values must be freed by the caller. so know which one you're holding, okay?? do not be out here freeing the library's stuff. π
πΈ DESCRIPTION πΈ
β¨ for AF_QUERYTYPE_FILEFMT β¨
these are the valid values for arg1, babes:
AF_QUERY_LABELβ request a short label string for the format (e.g.,"aiff").AF_QUERY_NAMEβ request a short name for the format (e.g.,"MS RIFF WAVE").AF_QUERY_DESCβ request a descriptive name for the format (e.g.,"Audio Interchange File Format").AF_QUERY_IMPLEMENTEDβ request a boolean value indicating whether the format is implemented for reading and writing in the Audio File Library.AF_QUERY_ID_COUNTβ request the total number of formats implemented.AF_QUERY_IDSβ request an integer array of the id token values of all implemented file formats.AF_QUERY_COMPRESSION_TYPESβ used with the selectorAF_QUERY_VALUE_COUNTinarg2, this will return a long integer containing the number of compression schemes available for use within the format specified inarg3. used with selectorAF_QUERY_VALUES, it returns a pointer to an integer array containing the compression id values of the compression schemes supported by the format specified inarg3. two moods, one selector. πAF_QUERY_SAMPLE_FORMATSβ used with the selectorAF_QUERY_DEFAULTinarg2, this will return the default sample format for the file format specified inarg3.AF_QUERY_SAMPLE_SIZESβ used with selectorAF_QUERY_DEFAULTinarg2, this will return the default sample width for the file format specified inarg3.
π§ for AF_QUERYTYPE_INST π§
these are the valid selectors for arg1:
AF_QUERY_SUPPORTEDβ request a boolean value indicating whether the file format inarg2supports instruments.AF_QUERY_MAX_NUMBERβ request an integer value indicating the maximum number of instruments supported by the file format inarg2.
π for AF_QUERYTYPE_INSTPARAM π
these are the valid selectors for arg1:
AF_QUERY_SUPPORTEDβ request a boolean value indicating whether the file format inarg2supports instrument parameters.AF_QUERY_ID_COUNTβ request an integer value indicating the number of instrument parameters supported by the file format inarg2.AF_QUERY_IDSβ request an integer array containing the instrument parameter values for the file format inarg2.AF_QUERY_TYPEβ for the file format inarg2, request the type of the instrument parameter inarg3.AF_QUERY_NAMEβ for the file format inarg2, request the name of the instrument parameter inarg3.AF_QUERY_DEFAULTβ for the file format inarg2, request the default value of the instrument parameter inarg3.
π ERRORS π
afQuery can produce these little disasters:
AF_BAD_QUERYTYPEβ the query type is unsupported.AF_BAD_QUERYβ the arguments to the query are bad.
not me getting AF_BAD_QUERY because my args were mid π double check those selectors before you come for the library, okay?
π AUTHOR π
Michael Pruett <michael@68k.org> β the icon, the legend, the moment. π«Ά
and that's the whole page, bestie!! this was Audio File Library 0.3.6, dated 03/06/2013, and it ate. go query something iconic. 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