libaudiofile.3(3) Introduction to Library Functions libaudiofile.3(3)
NAME
libaudiofile - audio file library
SYNOPSIS
#include <audiofile.h>
#include <aupvlist.h>
#include <af_vfs.h>
DESCRIPTION
The audio file library provides a uniform programming interface to standard digital audio file formats. This library allows the processing
of audio data to and from audio files of many common formats (currently AIFF, AIFF-C, WAVE, NeXT/Sun .snd/.au, and IRCAM). The library
also supports compression (currently G.711 mu-law, A-law, IMA, and MS ADPCM) as well as PCM formats of all flavors (signed and unsigned
integer, floating point and double-precision floating point).
audiofile.h contains all of the public interfaces to the library. aupvlist.h contains the interfaces to the parameter value list data
structures and routines. af_vfs.h should only be included if using audio file library through virtual file operations.
EXTENDED DESCRIPTION
One premise of the audio file library is that the data presented to an application need not be in the same format as the data contained in
the file. Another, however, is that the capabilities of the file format are exposed to the application programmer should the programmer
wish to take advantage of them.
To read from a file containing audio data, you typically use the following sequence of function calls:
AFfilehandle afOpenFile (const char *filename, const char *mode, AFfilesetup setup);
int afReadFrames (AFfilehandle, int track, void *buffer, int frameCount);
int afCloseFile (AFfilehandle file);
To write to a file, you typically use a similar sequence of commands:
AFfilesetup afNewFileSetup (void);
AFfilehandle afOpenFile (const char *filename, const char *mode, AFfilesetup setup);
int afWriteFrames (AFfilehandle, int track, const void *buffer,
int frameCount);
int afCloseFile (AFfilehandle file);
Data format transparency is achieved in the audio file library by providing the data in a virtual format. The virtual format consists of a
virtual byte order and a virtual sample format. Virtual byte order is by default set to the host byte order and does not depend on the
native byte order of the file format being used. Virtual sample format is by default in an uncompressed format.
The current audio file library does not support the concept of a virtual sampling rate, but this may be supported in the future.
At present, the audio file library supports only CCITT G.711 mu-law/A-law compression.
An audio file is manipulated through the AFfilehandle opaque data type. Calls to the library are made with this file handle as an argument.
When opening a file for writing, another opaque data structure called AFfilesetup is used. This structure is then passed to calls that set
various file parameters at the time the file is created, such as its file type and data format. Such properties cannot be modified for an
existing file.
Functions
The following functions are available through the library:
afNewFileSetup Create a file setup structure.
afFreeFileSetup Free a file setup structure.
afOpenFile Create a file handle structure given a file name and optionally a file setup.
afCloseFile Close an open audio file.
afSyncFile Update an audio file that has been opened for writing.
afSetVirtual{ByteOrder,CSetnvirtualMformat,forpaudiomdata within a specified track.
afInit{ByteOrder,ChannelSetaparametersoofaan AFfilesetup structure which will be used to open an audio file for writing.
afQuery Query regarding the capabilities of the audio file library.
afQueryLong Query whether the data is of type long.
afQueryPointer Query whether the data is of type pointer.
afQueryDouble Query whether the data is of type double.
afSetLoop* The group of functions that set loop parameters.
afGetLoop* The group of functions that get loop parameters.
afSetMark* The group of functions that set mark parameters.
afGetMark* The group of functions that get mark parameters.
afSetInst* The group of functions that set instrument parameters.
afGetInst* The group of functions that get instrument parameters.
afGetAESChannelData Get AES channel data for a given audio file.
afSetAESChannelData Set AES channel data for a given audio file.
afInitAESChannelData Specify that storage space is to be allocated for AES channel status data in a given audio file.
afInitAESChannelDataTo Specify whether storage space is to be allocated for AES channel status data in a given audio file.
FILES
The following files are used by this application:
/usr/libaudiofile.so Audio file shared library
/usr/include/audiofile.hPublic interfaces C header file
/usr/include/aupvlist.h Parameter value list C header file
/usr/include/af_vfs.h Virtual File System C header file
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWgnome-audio-devel SUN- |
| |Wgnome-audio |
+-----------------------------+-----------------------------+
|Interface stability |External |
+-----------------------------+-----------------------------+
SEE ALSO
audiofile-config(1), libesd(3)
NOTES
Written by Ghee Teo, Sun Microsystems Inc., 2003. This library is provided as an Open Source project by Silicon Graphics.
SunOS 5.10 3 Apr2003 libaudiofile.3(3)