Au file format
![]() | This article includes a improve this article by introducing more precise citations. (January 2013) ) |
Filename extension |
.au .snd |
---|---|
Type code | |
μ-law |
The Au file format is a simple
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 device file interface. This encoding and interface became a de facto standard for Unix sound.
New format
All fields are stored in
uint32 word | field | Description |
---|---|---|
0 | Magic number | The value 0x2e736e64 (four ASCII characters ".snd") |
1 | Data offset | The offset to the data in bytes. (In the older Sun version, this had to be a multiple of 8.) The minimum valid number is 28 (decimal), since this is the header length (six 32-bit words) plus a minimal annotation size (4 bytes, another 32-bit word). |
2 | data size | Data size in bytes, not including the header. If unknown, the value 0xffffffff should be used. |
3 | Encoding | Data encoding format:
Values 0 through 255 are supposed to be assigned by a file format authority (was NeXT, now Oracle). Other values can be used for custom formats.[5] |
4 | Sample rate | The number of samples/second, e.g., 8000, 11025, 22050, 44100, and 48000.[4] NeXT may use 8013.[5] |
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. |
6 | – | Optional annotation or description string, NULL-terminated. A minimum of 4 bytes must be stored even if unused.
In the older Sun version, its length had to be a non-zero multiple of 8 bytes. In some older implementations, the string is not properly NULL-terminated, but the offset remains reliable.[4] |
The type of encoding depends on the value of the "encoding" field (word 3 of the header). Formats 2 through 7 are uncompressed linear
Note: PCM formats are encoded as signed data (as opposed to unsigned).
The current format supports only a single audio data segment per file. The variable-length annotation field is currently ignored by most audio applications.
References
- ^ a b "audio/basic". IANA.org. Retrieved 23 February 2023.
- Apple Inc.
- Apple Inc.
- ^ a b c Oracle man pages: au(4) - AU audio file format (current specification)
- ^ a b c "Audio File Formats FAQ: File Formats". sox.sourceforge.net. Archived from the original on 23 February 2023.
- ^ "Audio File and Compression Formats". docs.oracle.com.
External links
- Oracle man pages: audio(7i) - generic audio device interface (for information on the /dev/audio interface)