source: trunk/third/audiofile/docs/afIntro @ 17099

Revision 17099, 3.4 KB checked in by ghudson, 23 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r17098, which included commits to RCS files with non-trunk default branches.
Line 
1The purpose of the Audio File Library is to provide transparency to
2the programmer of file formats and data formats.
3
4BASICS
5
6Audio files contain a sequence of amplitudes sampled at a particular
7rate, called the sampling frequency.  The method by which sounds can
8be acquired or generated in this manner is referred to as pulse-code
9modulation (PCM).  The representation of these amplitudes varies from
10one file format to another.  Common representations for these data are
11two's complement integers, unsigned integers, and floating-point
12numbers.
13
14For uncompressed audio, a track within an audio file consists of a
15sequence of frames, each of which contains a number of samples equal to
16the number of channels in the track.  For example, in a stereo track,
17every frame contains two samples.
18
19To read from a file containing audio data, the following sequence of
20function calls are typically used:
21
22afOpenFile
23afReadFrames
24afCloseFile
25
26To write to a file, a similar sequence of commands is typically
27employed:
28
29afNewFileSetup
30afOpenFile
31afWriteFrames
32afCloseFile
33
34Data format transparency is achieved in the Audio File Library by
35providing the data in a virtual format.  The virtual format consists of
36a virtual byte order and a virtual sample format.  Virtual byte order
37is by default set to the host byte order and does not depend on the
38native byte order of the file format being used.  Virtual sample format
39is by default in an uncompressed format.
40
41The current Audio File Library does not support the concept of a virtual
42sampling rate, but this may be supported in the future.
43
44At the present, the Audio File Library supports only CCITT G.711
45mu-law/A-law compression.
46
47PROGRAMMING PARADIGM
48
49An audio file is manipulated through the AFfilehandle opaque data
50type.  Calls to the library are made with this file handle as an
51argument.  When opening a file for writing, another opaque data
52structure called AFfilsetup is used.  This structure is then passed to
53calls which set various file parameters which are set at the time the
54file is created, such as its file type and data format; such
55properties cannot be modified for an existing file.
56
57FUNCTIONS
58
59Calls available through the library include the following:
60
61afNewFileSetup - create a file setup structure
62afFreeFileSetup - free a file setup structure
63afOpenFile - create a file handle structure given a file name and
64        optionally a file setup
65afCloseFile - close an open audio file
66afSyncFile - update an audio file which has been opened for writing
67afSetVirtual{ByteOrder,Channels,PCMMapping,SampleFormat} - set virtual
68        format for audio data within a specified track
69afInit{ByteOrder,Channels,Rate,SampleFormat} - set parameters of an
70        AFfilesetup structure which will be used to open an audio file for
71        writing
72
73afQuery - query regarding the capabilities of the Audio File Library
74afQueryLong
75afQueryPointer
76afQueryDouble
77
78afSetLoop* - set loop parameters
79afGetLoop* - get loop parameters
80
81afSetMark* - set mark parameters
82afGetMark* - get mark parameters
83
84afSetInst* - set instrument parameters
85afGetInst* - get instrument parameters
86
87afGetAESChannelData - get AES channel data for a given audio file
88afSetAESChannelData - set AES channel data for a given audio file
89afInitAESChannelData - specify that storage space is to be allocated
90        for AES channel status data in a given audio file
91afInitAESChannelDataTo - specify whether storage space is to be allocated
92        for AES channel status data in a given audio file
Note: See TracBrowser for help on using the repository browser.