---
name: "afQuery"
section: "3"
platform: "linux"
package: "audiofile"
version: "0.3.6-12"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/afQuery"
---

# afQuery(3)

query the capabilities of the Audio File Library

## NAME

afQuery, afQueryLong, afQueryDouble, afQueryPointer - query the capabilities of the Audio File Library

## 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

*querytype* can be one of the following:

•

AF\_QUERYTYPE\_FILEFMT

•

AF\_QUERYTYPE\_INST

•

AF\_QUERYTYPE\_INSTPARAM

•

AF\_QUERYTYPE\_COMPRESSION

•

AF\_QUERYTYPE\_COMPRESSIONPARAM

•

AF\_QUERYTYPE\_MISC

•

AF\_QUERYTYPE\_MARK

•

AF\_QUERYTYPE\_LOOP

*arg1*, *arg2*, *arg3*, and *arg4* are integer selectors whose meaning depends upon *querytype*.

## RETURN VALUE

Upon success, afQuery will return a non-null AUpvlist value. Upon failure, afQuery will return null while afQueryLong and afQueryDouble will return -1 and afQueryPointer will return null.

Pointers representing character strings are owned by the Audio File Library and must not be freed; all other pointer values must be freed by the caller.

## DESCRIPTION

For AF\_QUERYTYPE\_FILEFMT, the following selectors are valid values for *arg1*:

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 selector AF\_QUERY\_VALUE\_COUNT in *arg2*, this will return a long integer containing the number of compression schemes available for use within the format specified in *arg3*. Used with selector AF\_QUERY\_VALUES, it returns a pointer to an integer array containing the compression id values of the compression schemes supported by the format specified in *arg3*.

AF\_QUERY\_SAMPLE\_FORMATS

Used with the selector AF\_QUERY\_DEFAULT in *arg2*, this will return the default sample format for the file format specified in *arg3*.

AF\_QUERY\_SAMPLE\_SIZES

Used with selector AF\_QUERY\_DEFAULT in *arg2*, this will return the default sample width for the file format specified in *arg3*.

For AF\_QUERYTYPE\_INST, the following selectors are valid for *arg1*:

AF\_QUERY\_SUPPORTED

Request a boolean value indicating whether the file format in *arg2* supports instruments.

AF\_QUERY\_MAX\_NUMBER

Request an integer value indicating the maximum number of instruments supported by the file format in *arg2*.

For AF\_QUERYTYPE\_INSTPARAM, the following selectors are valid for *arg1*:

AF\_QUERY\_SUPPORTED

Request a boolean value indicating whether the file format in *arg2* supports instrument parameters.

AF\_QUERY\_ID\_COUNT

Request an integer value indicating the number of instrument parameters supported by the file format in *arg2*.

AF\_QUERY\_IDS

Request an integer array containing the instrument parameter values for the file format in *arg2*.

AF\_QUERY\_TYPE

For the file format in *arg2*, request the type of the instrument parameter in *arg3*.

AF\_QUERY\_NAME

For the file format in *arg2*, request the name of the instrument parameter in *arg3*.

AF\_QUERY\_DEFAULT

For the file format in *arg2*, request the default value of the instrument parameter in *arg3*.

## ERRORS

afQuery can produce the following errors:

AF\_BAD\_QUERYTYPE

The query type is unsupported.

AF\_BAD\_QUERY

The arguments to the query are bad.

## AUTHOR

Michael Pruett \<michael@68k.org\>
