| 1 |
afInitByteOrder(3) |
| 2 |
================== |
| 3 |
|
| 4 |
NAME |
| 5 |
---- |
| 6 |
afInitCompression - initialize compression for a track in an audio |
| 7 |
file setup |
| 8 |
|
| 9 |
SYNOPSIS |
| 10 |
-------- |
| 11 |
#include <audiofile.h> |
| 12 |
|
| 13 |
void afInitCompression(AFfilesetup setup, int track, int compression); |
| 14 |
|
| 15 |
PARAMETERS |
| 16 |
---------- |
| 17 |
`setup` is a valid file setup returned by linkaf:afNewFileSetup[3]. |
| 18 |
|
| 19 |
`track` specifies a track within the audio file setup. `track` is always |
| 20 |
`AF_DEFAULT_TRACK` for all currently supported file formats. |
| 21 |
|
| 22 |
`compression` is an identifier specifying the compression type (such as |
| 23 |
`AF_COMPRESSION_G711_ULAW`) to be used for audio data in the track. |
| 24 |
|
| 25 |
DESCRIPTION |
| 26 |
----------- |
| 27 |
Given an `AFfilesetup` structure created with linkaf:afNewFileSetup[3] |
| 28 |
and a track identified by `track` (`AF_DEFAULT_TRACK` for all currently |
| 29 |
supported file formats), `afInitCompression` initializes the track to |
| 30 |
the specified compression. |
| 31 |
|
| 32 |
The following compression types are currently supported: |
| 33 |
|
| 34 |
`AF_COMPRESSION_NONE`:: no compression |
| 35 |
`AF_COMPRESSION_G711_ULAW`:: CCITT G.711 mu-law encoding |
| 36 |
`AF_COMPRESSION_G711_ALAW`:: CCITT G.711 A-law encoding |
| 37 |
`AF_COMPRESSION_IMA`:: IMA ADPCM encoding |
| 38 |
`AF_COMPRESSION_MS_ADPCM`:: MS ADPCM encoding |
| 39 |
`AF_COMPRESSION_FLAC`:: FLAC |
| 40 |
`AF_COMPRESSION_ALAC`:: Apple Lossless Audio Codec |
| 41 |
|
| 42 |
ERRORS |
| 43 |
------ |
| 44 |
`afInitCompression` can produce the following errors: |
| 45 |
|
| 46 |
`AF_BAD_FILESETUP`:: `setup` represents an invalid file setup. |
| 47 |
`AF_BAD_TRACKID`:: `track` represents an invalid track identifier. |
| 48 |
`AF_BAD_COMPTYPE`:: `compression` represents an invalid compression type. |
| 49 |
|
| 50 |
SEE ALSO |
| 51 |
-------- |
| 52 |
linkaf:afNewFileSetup[3], |
| 53 |
linkaf:afInitSampleFormat[3] |
| 54 |
|
| 55 |
AUTHOR |
| 56 |
------ |
| 57 |
Michael Pruett <[email protected]> |