This is an unofficial AU audio file test suite.
The toisto-runner.py
script runs the test suite for the command given to it.
Here's examples running the test suite for the macOS AudioToolBox framework and Python sunau module. AudioToolBox requires building its tester before running it and python sunau is available in Python versions less than 3.13.
# for macOS
cd tools
clang++ ... # see audiotoolbox-au-tester.mm for compilation instructions
cd ..
python3 toisto-runner.py -v tools/audiotoolbox-au-tester
# Total 89: 50 passed, 18 failed, 21 ignored.
python3 toisto-runner.py -v tools/python3-au-tester.py
# Total 89: 43 passed, 25 failed, 21 ignored.
The results for macOS 14.4 AudioToolBox running
audiotoolbox-au-tester
.
The test files are under the tests
folder. The folder contains subfolders:
au
- contains valid AU test filesexported
- contains test files exported from various appsinvalid
- contains invalid AU files
The invalid
folder contains invalid AU files. The readers may or may not read them,
but hopefully they won't crash reading them. All files in the invalid
folder have
been marked to be ignored in the results.
Note: Some apps (Audacity and QuickTime Player 7) export only a 24-byte header, but the spec says that the minimum header size is 28 bytes. So, those apps are writing invalid AU files, but most apps seem to be able to read them.
Each audio file has a json file describing the expected result for reading the audio file. The properties in the json file are:
testinfo
- meta info about the testdescription
- short description of the test filenotes
- additional notes about the testsoftware
- name of the software used to create the file, if this is missing, then the file was created manually in a hex editorversion
- version of the softwareplatform
- platform used to run the software ("macOS 12.4" / "Windows 7" ..)command
- command line tool and its arguments used to create the file
result
-ignore
to ignore the test in the resultsformat
- alwaysau
sampleRate
- sample ratechannels
- number of channelscodec
- the compression type or type of uncompressed pcm sample data:pcm_bei
=signed big-endian integer,pcm_lei
=signed little-endian integer,pcm_bef
=signed big-endian floating point<number>
=encoding number (0-27) for non-PCM encodings (2-7)sampleSize
- for uncompressed encodings, the sample size in bits 8, 16, 24, 32 or 64, and for compressed encodings, the decoded sample size (0 for unknown sizes)desc
- a list of bytes in the description info field (only for description tests)samplesPerChannel
- the number of samples per channel after samples have been decodedtolerance
- how much sample values may differ from the expected values, default is 0startSamples
- a list of channels containing a list of samples (only the first 100-300 samples)endSamples
- a list of channels containing a list of samples (only the last 30 samples)
See reftemplate.json for examples for all the fields.
toisto-runner.py
compares each of these fields (except testinfo
) against
the values returned by the command. If the fields match, the test passes.
If the command returns "-unsupported-"
, it means that the field is not
supported by the command and it won't affect the result of the test.
The startSamples
and endSamples
properties in the json file contain samples
for each channel. The range of values depends on sampleSize
:
Sample size | Range |
---|---|
8 | [-128, 127] |
16 | [-32768, 32767] |
24 | [-8388608, 8388607] |
32 | [-2147483648, 2147483647] or floats |
64 | floats |
- The "spec": Oracle Solaris AU man page
- Oracle Solaris audioconvert man page
- NextSTEP sndconvert man page
- Audio File Formats FAQ: File Formats
- NeXT soundstruct.h
- SunOS audio_filehdr.h
- NeXT/Sun soundfile format
- Apple AudioToolBox framework
- Python3 sunau module
All test files and source code is licensed under CC0.