This is an unofficial AIFF / AIFF-C 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 macOS Audio ToolBox framework or
python aifc module. audiotoolbox-aiff-tester
requires building it before running it.
# for macOS
cd tools
clang++ ... # see audiotoolbox-aiff-tester.mm for compilation instructions
cd ..
python3 toisto-runner.py -v tools/audiotoolbox-aiff-tester
# Total 153: 104 passed, 22 failed, 27 ignored.
# NOTE: install tinytag to test id3 tags
python3 toisto-runner.py -v tools/python3-aiff-tester.py
# Total 153: 75 passed, 51 failed, 27 ignored.
The results for Audio ToolBox framework running
audiotoolbox-aiff-tester
.
The test files are under the tests
folder. They are valid AIFF/AIFF-C
audio files. The folder contains subfolders:
aifc
- contains AIFF-C test filesaiff
- contains AIFF test filescompressed
- contains AIFF-C test files with compressed sample dataexported
- contains test files exported from various appsinvalid
- contains invalid AIFF and AIFF-C files
The invalid
folder contains invalid files. The readers may or may not read them,
but hopefully they won't crash reading them. The "unspecified" files contain
non-ASCII characters in textual fields, which are not allowed by the spec.
However, macOS Audio Toolbox framework seems to read them as ISO 8859-1 or UTF-8.
All files in the invalid
folder have been marked to be ignored in the results.
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 results -
format
- format of the file:aiff
oraifc
-
sampleRate
- sample rate -
channels
- number of channels -
codec
- the compression type or type of uncompressed pcm sample data:pcm_bei
=signed big-endian integer,pcm_lei
=signed little-endian integer,pcm_beu
=unsigned big-endian integer,pcm_bef
=signed big-endian floating point -
sampleSize
- for uncompressed encodings, the sample size in bits 0-32 or 64, and for compressed encodings, the decoded sample size (0 for variable sample size) -
chunks
- chunk data:markers
- a list of markers (the MARK chunk)id
- id of the markerposition
- position of the markername
- name of the marker
comments
- a list of comments (the COMT chunk)timeStamp
- time stampmarker
- marker idtext
- comment text
inst
- the instrument chunk data with fields:baseNote
,detune
,lowNote
,highNote
,lowVelocity
,highVelocity
,gain
,sustainLoop
(playMode
,beginLoop
,endLoop
),releaseLoop
(playMode
,beginLoop
,endLoop
)midi
- a list of a list of bytes in the MIDI chunks (multiple MIDI chunks are allowed)aesd
- a list of bytes in the AESD chunkappl
- a list of bytes in the APPL chunkname
- text of the NAME chunkauth
- text of the AUTH chunk(c)
- text of the (c) chunkanno
- a list of annotations (the ANNO chunks)id3
- id3 tags (the ID3 chunk)chan
- channel layout (the CHAN chunk) with fields:channelLayoutTag
,channelBitmap
,channelDescriptions
(label
,flags
,coordinates
)hash
- an array of 20 bytes containing the SHA-1 hash of the audio data
-
samplesPerChannel
- the number of samples per channel after samples have been decoded (this may differ from the COMM chunk numSampleFrames value) -
tolerance
- how much sample values may differ from the expected values, default is 0 -
startSamples
- 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 |
---|---|
1..8 | [-128, 127] |
9..16 | [-32768, 32767] |
17..24 | [-8388608, 8388607] |
25..31 | [-2147483648, 2147483647] |
32 | [-2147483648, 2147483647] or floats |
64 | floats |
- AIFF/AIFF-C Specifications
- Apple documentation about supported audio file formats in Mac OS X 10.5
- wiki.multimedia.cx: ima4
- wiki.multimedia.cx: Qclp
- wiki.multimedia.cx: QDesign Music Codec (QDMC / QDM2)
- wiki.multimedia.cx: MAC3/MAC6
- Apple comment about little-endian AIFF/AIFC files
- macOS Audio Toolbox framework
- Python3 AIFC module
- MIDI system exclusive message / Master Volume message
All test files and source code is licensed under CC0.