Au file format
The Au file format is a simple audio file format introduced by Sun Microsystems. The format was common on NeXT systems and on early Web pages. Originally it was headerless, being simply 8-bit μ-law-encoded data at an 8000 Hz sample rate. Hardware from other vendors often used sample rates as high as 8192 Hz, often integer multiples of video clock signal frequencies. Newer files have a header that consists of six unsigned 32-bit words, an optional information chunk and then the data.
Although the format now supports many audio encoding formats, it remains associated with the μ-law logarithmic encoding. This encoding was native to the SPARCstation 1 hardware, where SunOS exposed the encoding to application programs through the /dev/audio interface. This encoding and interface became a de facto standard for Unix sound.
New format
All fields are stored in big-endian format, including the sample data.32 bit word | field | Description/Content Hexadecimal numbers in C notation |
0 | magic number | the value |
1 | data offset | the offset to the data in bytes, must be divisible by 8. The minimum valid number is 24, since this is the header length with no space reserved for extra information. The minimum valid number with an annotation field present is 32. |
2 | data size | data size in bytes. If unknown, the value should be used. |
3 | encoding | Data encoding format:
|
4 | sample rate | the number of samples/second, e.g., 8000 |
5 | channels | the number of interleaved channels, e.g., 1 for mono, 2 for stereo; more channels possible, but may not be supported by all readers. |
Note: PCM formats are encoded as signed data.
Following the header structure is a variable-length annotation field. The contents of this field are currently undefined, except that its length must be a multiple of eight bytes and it must be terminated with at least one null byte. The audio data segment begins on an eight-byte boundary immediately following the annotation field. Audio data is encoded in the format identified by the file header. The current implementation supports only a single audio data segment per file. The variable-length annotation field is currently ignored by most audio applications.