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

# afInitFileFormat(3)

initialize file format of an audio file setup

## NAME

afInitFileFormat - initialize file format of an audio file setup

## SYNOPSIS

```
#include <audiofile.h>
```

```
void afInitFileFormat(AFfilesetup setup, int fileFormat);
```

## PARAMETERS

setup is a valid file setup created by [**afNewFileSetup**(3)](/afNewFileSetup/3.md).

fileFormat is an integer constant specifying a file format.

## DESCRIPTION

Given an AFfilesetup structure created with [**afNewFileSetup**(3)](/afNewFileSetup/3.md), afInitFileFormat initializes the file format to that specified by fileFormat.

The following file formats are currently supported:

AF\_FILE\_RAWDATA

raw audio data

AF\_FILE\_AIFF

Audio Interchange File Format

AF\_FILE\_AIFFC

Audio Interchange File Format AIFF-C

AF\_FILE\_NEXTSND

NeXT .snd/Sun .au

AF\_FILE\_WAVE

Microsoft RIFF WAVE

AF\_FILE\_BICSF

Berkeley/IRCAM/CARL Sound File

AF\_FILE\_AVR

Audio Visual Research

AF\_FILE\_IFF\_8SVX

Amiga IFF/8SVX

AF\_FILE\_SAMPLEVISION

Sample Vision

AF\_FILE\_VOC

Creative Voice File

AF\_FILE\_NIST\_SPHERE

NIST SPHERE

AF\_FILE\_CAF

Core Audio Format

## ERRORS

afInitFileFormat can produce the following errors:

AF\_BAD\_FILESETUP

setup represents an invalid file setup.

AF\_BAD\_FILEFMT

fileFormat represents an unknown file format.

AF\_BAD\_NOT\_IMPLEMENTED

fileFormat represents a file format which is not currently implemented.

## SEE ALSO

[**afNewFileSetup**(3)](/afNewFileSetup/3.md)

## AUTHOR

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