C Library Functions libaudiofile(3)
NAME
libaudiofile - audio file library
SYNOPSIS
#include
#include
#include
DESCRIPTION
The audio file library provides a uniform programming inter-
face to standard digital audio file formats. This library
allows the processing of audio data to and from audio files
of many common formats (currently AIF, AIF-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 float-
ing 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. afvfs.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);
SunOS 5.11 Last change: 3 Apr2003 1
C Library Functions libaudiofile(3)
Data format transparency is achieved in the audio file
library by providing the data in a virtual format. The vir-
tual 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 CIT 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 han-
dle 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,CSetnvir,tPuCaMlformat,SforleFaudiot}data
within a specified track.
SunOS 5.11 Last change: 3 Apr2003 2
C Library Functions libaudiofile(3)
afInit{ByteOrder,ChannelS,eRtatp,aSrameteFrsrmof} an 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.
SunOS 5.11 Last change: 3 Apr2003 3
C Library Functions libaudiofile(3)
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.h Public interfaces C header
file
/usr/include/aupvlist.h Parameter value list C
header file
/usr/include/afvfs.h Virtual File System C header
file
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 3 Apr2003 4
C Library Functions libaudiofile(3)
ATRIBUTE TYPE ATRIBUTE VALUE
Availability SUNWgnome-audio
Interface stability Volatile
SEE ALSO
audiofile-config(1), libesd(3), attributes(5)
NOTES
Written by Ghee Teo, Sun Microsystems Inc., 2003. This
library is provided as an Open Source project by Silicon
Graphics.
SunOS 5.11 Last change: 3 Apr2003 5
|