Au file format
View on Wikipedia| Au | |
|---|---|
| Filename extension |
.au .snd |
| Internet media type | audio/basic (headerless format)[1] |
| Type code | |
| Magic number | .snd (newer versions) |
| Developed by | Sun Microsystems |
| Type of format | audio file format, container format |
| Container for | Audio, most often μ-law |
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 8-bit μ-law-encoded data at an 8000 Hz sample rate.[1] 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 which is always of non-zero size, and then the data (in big-endian format).
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
[edit]All fields are stored in big-endian format, including the sample data.[4][5]
| 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 PCM, therefore technically lossless (although not necessarily free of quantization error, especially in 8-bit form). Formats 1 and 27 are μ-law and A-law, respectively, both companding logarithmic representations of PCM, and arguably lossy, as they pack what would otherwise be almost 16 bits of dynamic range into 8 bits of encoded data, even though this is achieved by an altered dynamic response and no data are discarded. Formats 23 through 26 are ADPCM, which is an early form of lossy compression, usually with four bits of encoded data per audio sample (for 4:1 efficiency with 16-bit input, or 2:1 with 8-bit input). Several of the others (number 8 through 22) are DSP commands or data, designed to be processed by the NeXT Music Kit software.
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
[edit]- ^ a b "audio/basic". IANA.org. Retrieved 23 February 2023.
- ^ "AVFileTypeSunAU". Apple Developer Documentation. Apple Inc.
- ^ "System-Declared Uniform Type Identifiers". Uniform Type Identifiers Reference. 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
[edit]- Oracle man pages: audio(7i) — generic audio device interface (for information on the /dev/audio interface)
Au file format
View on Grokipedia.snd (hexadecimal 0x2e736e64)—include the offset to the audio data (typically 24 bytes), the data size (or a sentinel value for unknown length), the encoding identifier, the sample rate in Hz, and the number of channels, allowing for precise playback without external metadata.[1] This design prioritizes simplicity and efficiency, with linear encodings using zero-centered signed integers and floating-point variants normalized between -1.0 and 1.0, ensuring compatibility with telephony standards like G.711 for μ-law and A-law.[1] While not optimized for compression, the format's extensibility through the annotation field and support for higher-fidelity encodings have sustained its niche role in professional audio workflows and open-source software ecosystems.[1]
History
Development
The Au file format was developed by Sun Microsystems in the late 1980s to support audio capabilities on their Unix-based workstations, with initial implementation tied to the SPARCstation 1 hardware launched in April 1989.[1][5] Originally designed as a headerless format containing raw 8-bit μ-law encoded audio at an 8 kHz sample rate, the AU format evolved to include a structured 24-byte header in later implementations, enhancing its utility for diverse audio applications.[2] The format emerged as a straightforward solution for storing and playing back digital audio on these systems, emphasizing simplicity and compatibility with 8-bit hardware audio interfaces without requiring advanced compression techniques.[1][5] Sun's engineering efforts focused on integrating the format into SunOS, enabling tools like soundtool for recording, playback, and basic editing of .au files directly on the SPARCstation 1.[5] The same format, often using the .snd extension, was adopted for NeXT Computer systems released in October 1988, where it formed the basis of the NeXT Sound Kit developed by David A. Jaffe and Lee Boynton to facilitate audio processing in the NeXTSTEP environment.[6] Public documentation of the Au format first appeared in the SunOS 4.1 Reference Manual in March 1990, detailing its structure and use in conjunction with the /dev/audio device driver introduced for SPARC-based systems.[5] This timeline aligned with the broader rollout of multimedia features in Unix workstations, positioning Au as an early standard for interchangeable audio data across compatible platforms.[1]Adoption and legacy
The Au file format achieved widespread adoption in the early 1990s on Unix-based operating systems, including SunOS and Solaris, where it served as the standard for system sounds, application audio, and telephony-related recordings developed by Sun Microsystems.[7][8] It was similarly prevalent on NeXTSTEP, the proprietary operating system for NeXT workstations, integrating seamlessly with hardware audio capabilities for multimedia applications and user interfaces.[9][10] Beginning in 1993, the format played a key role in the early evolution of the web, with NCSA Mosaic version 1.0 introducing native support for embedding and playing .au audio files directly within HTML pages, enabling the first widespread use of inline audio on the internet.[11] Netscape Navigator followed suit, supporting .au files either internally or via helper applications, which contributed to its status as one of the most common audio formats for web content during this period.[12] By 1995, .au files were described as a dominant internet audio standard due to their simplicity and compatibility with Unix environments.[13] The format's prominence waned in the mid-1990s as uncompressed alternatives like WAV gained favor for professional audio on Windows and Macintosh platforms, while compressed formats such as MP3 revolutionized web and portable media with superior efficiency and quality.[3][10] Despite this decline, Au's legacy endures through preservation efforts in open-source software, including tools like SoX for command-line audio processing and Audacity for editing and conversion, ensuring compatibility for archival and historical audio files from Unix-era systems.[14][4]Technical specifications
File structure
The Au file format consists of three primary components: a fixed 24-byte header, an optional variable-length annotation block, and a contiguous segment of raw audio data.[1][15] The header provides essential metadata, while the annotation block, if present, contains null-terminated human-readable descriptive text such as comments or titles padded with null bytes to a multiple of 8 bytes, and the audio data follows as unframed bytes interpreted according to the header's encoding specifications.[1] In terms of data organization, the header includes an offset field that specifies the starting position of the audio data from the beginning of the file, allowing the annotation block—when included—to occupy the space immediately following the header up to that offset.[15] This setup ensures the annotation precedes the audio data in standard files, with the audio segment beginning on an eight-byte boundary for alignment.[1] The audio data itself lacks additional framing or headers, consisting solely of sequential sample bytes.[15] Au files do not incorporate built-in padding beyond any necessary alignment for the annotation block to an eight-byte boundary.[1] The total file size is determined by the header's data size field, which is a 32-bit unsigned integer; this supports theoretical file sizes up to approximately 4 GB, though the field may be set to a special value (0xFFFFFFFF) to indicate an unknown or unlimited data length.[15] For file validation and identification, Au files must begin with the magic number ".snd" (0x2e736e64 in hexadecimal), encoded in big-endian byte order as the first four bytes of the header.[1][15] This signature distinguishes the format and enables parsers to confirm compliance before processing the offset and subsequent elements.[1]Header details
The AU file header is a fixed-size 24-byte structure composed of six 32-bit unsigned integers stored in big-endian byte order, which provides essential metadata about the audio content.[1] This header precedes any optional annotation block and the audio data itself, ensuring compatibility across systems.[15] The fields are laid out sequentially as follows:| Offset | Field Name | Type | Description |
|---|---|---|---|
| 0 | magic | 32-bit unsigned int | Fixed magic number identifying the file as AU format: 0x2e736e64 (ASCII ".snd").[1] |
| 4 | data_offset | 32-bit unsigned int | Byte offset from the beginning of the file to the start of the audio data; typically 24 if no annotation block is present, or a multiple of 8 at least 32 to account for the padded annotation block.[1] |
| 8 | data_size | 32-bit unsigned int | Length of the audio data in bytes; a value of 0xFFFFFFFF (-1 interpreted as unsigned) indicates unknown size, with the data extending to the end of the file (EOF-terminated).[1] |
| 12 | encoding | 32-bit unsigned int | Numeric code specifying the audio encoding format (see table below).[1] |
| 16 | sample_rate | 32-bit unsigned int | Audio sampling rate in hertz (Hz), such as 8000 for telephone quality or 44100 for CD quality.[15] |
| 20 | channels | 32-bit unsigned int | Number of audio channels; 1 for mono, 2 for stereo.[1] |
| Code | Description |
|---|---|
| 1 | 8-bit μ-law (ITU-T G.711 companded format).[1] |
| 2 | 8-bit signed linear PCM.[1] |
| 3 | 16-bit signed linear PCM.[1] |
| 4 | 24-bit signed linear PCM.[1] |
| 5 | 32-bit signed linear PCM.[1] |
| 6 | 32-bit IEEE 754 single-precision floating-point.[1] |
| 7 | 64-bit IEEE 754 double-precision floating-point.[1] |
| 23 | 4-bit CCITT G.721 ADPCM.[1] |
| 25 | CCITT G.723 3-bit ADPCM.[1] |
| 27 | 8-bit A-law (ITU-T G.711 companded format).[1] |
2e 73 6e 64 18 00 00 00 ff ff ff ff 02 00 00 00 1f 40 00 00 01 00 00 00
This translates to: magic (0x2e736e64), offset (24), data_size (0xFFFFFFFF), encoding (2), sample_rate (8000), channels (1).[1]
Supported encodings
The Au file format supports several pulse-code modulation (PCM) variants for linear audio data, all of which are signed and zero-centered. These include 8-bit linear PCM, ranging from -128 to 127, 16-bit linear PCM using two's complement representation, and 24-bit and 32-bit linear PCM. The 16-bit variant is stored in big-endian byte order as the standard. An 8-bit unsigned linear PCM format, which would map values from 0 to 255 with a 128 offset, is not supported in the core specification.[1][15] For compressed audio, the format includes 8-bit μ-law encoding, a logarithmic companding method defined in the CCITT G.711 standard for telephony applications, primarily used in North America and Japan. Similarly, 8-bit A-law encoding provides comparable logarithmic compression as the European counterpart in G.711, offering slightly different quantization characteristics for voice signals. These compressed formats reduce the dynamic range to fit 8 bits while approximating human auditory perception.[1][15][16] Audio samples in Au files are processed with interleaved channels, where multi-channel data (typically mono or stereo) alternates samples from each channel sequentially, starting from the offset specified in the header. The format supports multi-channel audio with the number of channels specified in the header, typically mono or stereo but extensible to more channels. Beyond the header, no additional built-in metadata is embedded in the audio data segment. Decoding μ-law to linear PCM involves extracting the sign bit (polarity from bit 7 of the 8-bit codeword), the 3-bit exponent (or chord, from bits 6-4), and the 4-bit mantissa (or step, from bits 3-0), followed by inverting the codeword, removing bias, and expanding via the formula for the linear integer value:Usage and applications
In operating systems and hardware
The Au file format received native support in Solaris and SunOS operating systems, where it served as the standard audio format for playback through the built-in libaudio library and the /dev/audio device interface.[7][17] This integration allowed direct piping of Au files to the audio device for simple playback, particularly for 8-bit μ-law encoded data, which was the default encoding exposed by the hardware.[8] In NeXTSTEP and OPENSTEP, the Au format (often using the .snd extension with identical structure) was the default for system alerts and applications such as Sound.app, which handled recording and playback natively.[18][19] NeXT hardware, including the Motorola 56001 DSP chip, provided acceleration for audio processing, enabling efficient handling of Au-encoded sounds directly on the motherboard without additional software overhead.[20] Modern operating systems retain partial support for Au files as a legacy format. In Linux distributions, playback is possible through plugins and libraries compatible with ALSA and PulseAudio, such as libsndfile integrated in tools like SoX, though it lacks direct kernel-level device integration like in original Sun systems. On macOS, Au is supported via the Core Audio framework, inheriting legacy handling from the Darwin kernel's BSD subsystem, which traces back to NeXTSTEP roots.[21] Originally designed for SPARC-based hardware, Au files were optimized for the audio DACs in systems like the SPARCstation 1, which operated at an 8 kHz sample rate with μ-law encoding for telephony-grade audio output.[22] On non-SPARC architectures such as x86, compatibility is achieved through software emulation in modern audio stacks, converting the format to native hardware capabilities without dedicated acceleration.[7]In web and multimedia
The Au file format played a significant role in early web audio embedding, particularly through the HTML<embed> tag, which allowed simple integration of audio clips into pages starting in the mid-1990s. Its compact size and Unix origins made it ideal for bandwidth-limited connections, enabling sound effects and short clips on sites like The New York Times, where .au files were used for multimedia content as early as 1996.[3][23][24]
Au received strong browser support in Netscape Navigator 3.0 (1996) through the LiveAudio extension, which handled Au alongside WAV and AIFF.[25] In contrast, Microsoft Internet Explorer shifted focus to WAV by version 3 in 1996, reducing reliance on Au. Modern browsers, including Chrome, Firefox, and Safari, lack native support for Au in the HTML5 <audio> element, necessitating plugins, JavaScript libraries, or file conversion for playback.[26][27]
In multimedia applications, Au found use in Apple's QuickTime player, which provided cross-platform playback compatibility as documented in official specifications, supporting the format through version 7—the last major release before Apple ended Windows updates in 2016.[28][29] This integration facilitated Au's role in legacy media workflows until more advanced codecs emerged.
Contemporary limitations hinder Au's web viability: it offers no built-in streaming optimizations like progressive download or adaptive bitrate, resulting in poor performance over networks compared to MP3 or Ogg Vorbis, and experts recommend converting Au files for any modern multimedia deployment.[3][30]
Software and conversion support
Audacity provides full import and export support for the Au file format, allowing users to open, edit, and save audio files in this format through its standard file handling interface.[31] SoX, a command-line audio processing tool, offers robust conversion capabilities for Au files, enabling transformations to and from other formats like WAV without quality loss for uncompressed data.[32] Adobe Audition includes legacy support for importing Au files, facilitating editing of older audio archives originating from Sun Microsystems systems.[33] The libsndfile C library supports reading and writing Au files as part of its handling of Sun/NeXT formats, providing a standardized API for developers to integrate Au support into applications.[34] Similarly, the Java Sound API has included a built-in decoder for Au files since J2SE 1.3, allowing seamless playback and processing within Java-based audio programs.[35] Conversion workflows for Au files are straightforward using command-line tools; for example, SoX can convert an Au file to WAV with the commandsox input.au output.wav, preserving sample rates and channels where compatible.[32] FFmpeg supports both demuxing and muxing of Au files, enabling batch conversions for archival migration, such as ffmpeg -i input.au output.wav for multiple files via scripting.[36]
Universal playback and conversion support persists in modern tools like VLC Media Player and FFmpeg, which handle Au files natively across platforms for reproduction and format shifting.[36] Mobile applications exhibit limited direct support for Au files, often requiring desktop-based converters like SoX or FFmpeg before transfer to devices.
Comparisons and alternatives
Similarities and differences with WAV
The Au and WAV formats share several fundamental similarities as uncompressed audio container formats designed for straightforward storage and playback of raw audio data. Both primarily support pulse-code modulation (PCM) encoding, including linear PCM at various bit depths such as 8-bit, 16-bit, 24-bit, and 32-bit, as well as multi-channel configurations like mono and stereo.[1][37] They are header-based, with essential metadata (such as sample rate, channels, and encoding type) preceding the contiguous audio data block, making them suitable for simple, high-fidelity audio applications without complex compression.[1][38] This shared emphasis on uncompressed PCM enables lossless preservation of original audio quality, positioning both as go-to choices for professional audio editing and archiving where fidelity is paramount.[39][37] Despite these overlaps, Au and WAV diverge significantly in structure, flexibility, and platform orientation. Au employs a compact, fixed 24-byte header in big-endian (network) byte order, followed by an optional annotation block and the audio data, which prioritizes minimal overhead for quick parsing on resource-constrained systems.[1] In contrast, WAV is built on the Resource Interchange File Format (RIFF), featuring a variable-length structure of nested chunks—starting with a 12-byte RIFF header, followed by mandatory "fmt" and "data" chunks (typically totaling at least 44 bytes for basic PCM)—and uses little-endian byte order throughout.[38][37] Au lacks native support for embedded metadata beyond a basic text annotation, whereas WAV includes extensible INFO chunks for tags like artist, title, and comments, enhancing its utility in multimedia workflows.[1][38] These differences result in Au files having slightly smaller overhead (e.g., 24 bytes vs. WAV's minimum 44 bytes for equivalent PCM data), making Au more header-efficient for short clips.[1][37]| Aspect | Au Format | WAV Format |
|---|---|---|
| Header Size | Fixed 24 bytes | Variable (minimum ~44 bytes for basic PCM) |
| Endianness | Big-endian | Little-endian |
| Structure | Fixed header + optional annotation + data | RIFF chunks (e.g., "fmt", "data", optional INFO) |
| Metadata | Basic text annotation only | Extensible INFO chunks for tags |
| Supported PCM | 8/16/24/32-bit linear, plus μ-law, A-law, float | 8/16/24/32-bit linear, plus extensible formats like IEEE float |