Audio Interchange File Format: "AIFF"
A Standard for Sampled Sound Files
Version 1.3
Apple Computer, Inc.
______________________________________________________________________________ Modification History
Version 1.1January 21, 1988Original version.
Version 1.2June 17, 1988Corrected typographical error in illustration on
page 4.
Version 1.3January 4, 1989Apple II modifications. Changed Apple II file
type from 0xCB to 0xD8 on page 4. Defined
convention for using applicationSignature field
in Application Specific Chunk for Apple II on
page 15.
______________________________________________________________________________
The Audio Interchange File Format (Audio IFF) provides a standard for storing sampled sounds. The format is quite flexible, allowing for the storage of monaural or multichannel sampled sounds at a variety of sample rates and sample widths.
Audio IFF conforms to the "EA IFF 85"Standard for Interchange Format Files developed by Electronic Arts.
Audio IFF is primarily an interchange format, although application designers should find it flexible enough to u as a data storage format as well. If an application does choo to u a different storage format, it should be able to convert to and from the format defined in this document. This will facilitate the sharing of sound data between applications.
Audio IFF is the result of veral meetings held with music developers over a period of ten months in 1987-88. Apple Computer greatly appreciates the comments and cooperation provided by all develo
pers who helped define this standard.
Another "EA IFF 85" sound storage format is"8SVX" IFF 8-bit Sampled Voice, by Electronic Arts. "8SVX", which handles 8-bit monaural samples, is intended mainly for storing sound for playback on personal computers. Audio IFF is intended for u with a larger variety of computers, sampled sound instruments, sound software applications, and high fidelity recording devices.
Data types
A C-like language will be ud to describe data structures in this document. The data types ud are listed below:
char:8 bits, signed. A char can contain more than just ASCII characters. It
can contain any number from -128 to 127 (inclusive).
unsigned char:8 bits, unsigned. Contains any number from zero to 255 (inclusive). short:16 bits, signed. Contains any number from -32,768 to 32,767 (inclusive). unsigned short:16 bits, unsigned. Contains any number from zero to 65,535 (inclusive). long:32 bits, signed. Contains any number from -2,147,483,648 to
2,147,483,647 (inclusive).
unsigned long:32 bits, unsigned. Contains any number from zero to 4,294,967,295
prospective
(inclusive).
法律翻译
extended:80 bit IEEE Standard 754 floating point number (Standard Apple
Numeric Environment [SANE] data type Extended).
pstring:Pascal-style string, a one byte count followed by text bytes. The total
number of bytes in this data type should be even. A pad byte can be
added at the end of the text to accomplish this. This pad byte is not
specreflected in the count.
ID:32 bits, the concatenation of four printable ASCII character in the range '
' (SP, 0x20) through '~' (0x7E). Spaces (0x20) cannot precede printing
characters; trailing spaces are allowed. Control characters are forbidden. OSType:32 bits. A concatenation of four characters, as defined in Inside
Macintosh, vol II.
Constants
Decimal values are referred to as a string of digits, for example 123, 0, 100 are all decimal numbers. Hexadecimal values are preceded by a 0x - e.g. 0x0A12, 0x1, 0x64.
Data Organization All data is stored in Motorola 68000 format. Data is organized as follows:
12340567msb lsb char msb lsb 12340
56791112131415108short byte 0byte 1
12340567msb lsb
long byte 0byte 1
byte 2byte 391112131415108Referring to Audio IFF
The official name for this standard is Audio Interchange File Format. If an application program needs to prent the name of this format to a ur, such as in a "Save as…" dialog box, the name can be abbreviated to Audio IFF .
File Structure
The "EA IFF 85"Standard for Interchange Format Files defines an overall structure for storing data in files. Audio IFF conforms to the "EA IFF 85" standard. This document will describe tho portions of "EA IFF 85" that are germane to Audio IFF. For a more complete discussion of "EA IFF 85", plea refer to the document "EA IFF 85" Standard for Interchange Format Files.
An "EA IFF 85" file is made up of a number of chunks of data. Chunks are the building blocks of "EA IFF 85" files. A chunk consists of some header information followed by data:
A chunk.
header info }
A chunk can be reprented using our C-like language in the following manner:taibao
typedef struct {高级翻译张璐
ID ckID;/* chunk ID*/
long ckSize;/* chunk Size*/
char ckData[];/* data*/
} Chunk;
ckID describes the format of the data portion a chunk. A program can determine how to interpret the chunk data by examining ckID.
ckSize is the size of the data portion of the chunk, in bytes. It does not include the 8 bytes ud by ckID and ckSize.
allegro
ckData contains the data stored in the chunk. The format of this data is determined by ckID. If the data is an odd number of bytes in length, a zero pad byte must be added at the end. The pad byte is not included in ckSize .
Note that an array with no size specification (e.g. char ckData[];) indicates a variable-sized array in our C-like language. This differs from standard C.
An Audio IFF file is a collection of a number of different types of chunks. There is a Common Chunk which contains important parameters describing the sampled sound, such as it's length and sample rate. There is a Sound Data Chunk that contains the actual audio samples. There are veral other optional chunks that define markers, list instrument parameters, store application-specific information, etc. All of the chunks are described in detail in later ctions of this document.
The chunks in a Audio IFF file are grouped together in a container chunk. "EA IFF 85" defines a number of container chunks, but the one ud by Audio IFF is called a FORM. A FORM has the following format:
typedef struct {
easybuyID ckID;
兰花英文
dig的过去式long ckSize;
ID formType;
char chunks [];
} Chunk;
ckID is always 'FORM'. This indicates that this is a FORM chunk.
ckSize contains the size of data portion of the 'FORM' chunk. Note that the data portion has been broken into two parts, formType and chunks[].
formType describes what's in the 'FORM' chunk. For Audio IFF files, formType is always 'AIFF'. This indicates that the chunks within the FORM pertain to sampled sound. A FORM chunk of formType 'AIFF' is called a FORM AIFF.
上海大学分数线
chunks are the chunks contained within the FORM. The chunks are called local chunks. A FORM AIFF along with its local chunks make up an Audio IFF file.
Here is an example of a simple Audio IFF file. It consists of a file containing single FORM AIFF which contains two local chunks, a Common Chunk and a Sound Data Chunk.
FORM AIFF Chunk
ckID = 'FORM'
formType = 'AIFF'
Common Chunk
ckID = 'COMM'
Sound Data Chunk
ckID = 'SSND'
There are no restrictions on the ordering of local chunks within a FORM AIFF.
On an Apple II, the FORM AIFF is stored in a ProDOS file. The file type is 0xD8 and the aux type is 0x0000. AIFF versions 1.2 and earlier ud file type 0xCB, which is incorrect. Plea e the Apple
II File Type Note for file type 0xD8 and aux type 0x0000 for strategies on dealing with this inconsistency.
On a Macintosh, the FORM AIFF is stored in the data fork of an Audio IFF file. The Macintosh file type of an Audio IFF file is 'AIFF'. This is the same as the formType of the FORM AIFF.