AU: Difference between revisions

From Atari Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
   
 
{|
 
{|
| '''Bytes'''
+
| Bytes
| '''Offset'''
+
| Offset
| '''Content'''
+
| Content
 
|-
 
|-
| '''4'''
+
| 4
| '''0'''
+
| 0
| '''Magic number: .snd'''
+
| Magic number: .snd
  +
|-
 
  +
| 4
 
  +
| 3
 
4 3 Offset of the sound data from the beginning of the file = 23 + N
+
| Offset of the sound data from the beginning of the file = 23 + N
  +
|-
 
  +
| 4
4 7 Number of bytes of audio data
 
  +
| 7
 
 
| Number of bytes of audio data
4 11 Sound format code
 
  +
|-
 
  +
| 4
4 15 Sampling rate in samples per second
 
  +
| 11
 
 
| Sound format code
4 19 Number of channels
 
  +
|-
 
  +
| 4
N 23 Optional text describing data
 
  +
| 15
 
 
| Sampling rate in samples per second
K 23+N Audio data
 
  +
|-
  +
| 4
  +
| 19
 
| Number of channels
  +
|-
  +
| N
  +
| 23
 
| Optional text describing data
  +
|-
  +
| K
  +
| 23+N
 
| Audio data
 
|}
 
|}

Revision as of 23:01, 24 March 2016

Audio (AU) File Format files are a good example of a simple file type consisting of a header followed by data. There are actually two kinds of AU file. The suffix .au was originally introduced by Sun for headerless audio files containing ?-law compressed audio sampled at 8,000 samples per second. Subsequently, the the SND format was adopted on NeXT computers, and is the same as the AU format. AU files consists of a header with the following format followed by a single chunk of audio data. The numerical values in the header must be stored in big-endian format.

The following is the structure of an AU format file header:

Bytes Offset Content
4 0 Magic number: .snd
4 3 Offset of the sound data from the beginning of the file = 23 + N
4 7 Number of bytes of audio data
4 11 Sound format code
4 15 Sampling rate in samples per second
4 19 Number of channels
N 23 Optional text describing data
K 23+N Audio data