Introduction
True Audio (TTA) is a free, open-source lossless audio codec. It aims for fast, simple encoding and decoding rather than the smallest files, and was designed to be easy to use in hardware players. It is less common than FLAC, WavPack or Monkey’s Audio.
Structure
A TTA file starts with a 22-byte header: the signature TTA1, the audio
format, the channel count, bits per sample, the sample rate, the total number of
samples and a CRC-32 of the header. A seek table follows, giving the size of every
frame, with its own CRC-32. Then come the frames, each about one second of audio and
ending with a CRC-32. Numbers are little-endian. Tags, ID3 or APEv2, may be added at
the start or end of the file. The pages in the menu describe the
header and seek table, the
frames and their Rice coding, the
prediction and channels, the
variants and limits (encrypted files, bit depths, channel
counts and the TTA2 draft) and the tags.
Drop a .tta file on the explorer and it shows the header and the seek table with every
field named, every frame as a node and a row of a table (offset, size, samples, CRC checked), the waveform
decoded here with playback, the checks (every CRC, the seek table, the padding) and the tags and
pictures. An encrypted file has a password box (type the password; empty tries a short list), and the First frame,
Frames and First channel options move the waveform window over the whole file, so every frame and channel can be
seen and played (the Checks decode every frame). Floating-point files (audio format 3), 32-bit files and the TTA2 of
ttaenc-dev 2.0 are read too. A file that is cut, has a wrong seek table or
has bad frames is shown as far as it goes, with what is wrong labelled; text named .tta is
reported as not True Audio.
0Header TTA1, format, channels, bits, rate, samples, CRC22 bytes22Seek table frame sizes, CRCvaries…Frames compressed audio, CRC eachrepeated
Sample files
The reader and decoder in the explorer were checked against:
- four real files:
luckynight.tta(MPlayer samples: stereo 16-bit, 58 frames, 2,667,168 samples),inside.ttaandencrypted.tta(FFmpeg’s test suite; the second is audio format 2, passwordffmpeg) andluckynight-partial.tta(the first MiB of the first, so 9 frames are whole and the rest are cut). Every sample equals FFmpeg’s and every CRC is right, except in the cut file, where the 9 whole frames equal FFmpeg’s (it stops at the cut) and the viewer labels the tenth as cut and the other 48 as missing; - 130 files made for this check: 80 written by FFmpeg’s TTA encoder (1 to 8 channels, 8, 16 and 24 bits, sine, noise, silence, full-scale square waves, ramps and a mix, the rates from 8,000 to 192,000 Hz, and lengths around the frame size). Each decodes to the exact samples it was made from and to FFmpeg’s, and a research encoder written for this check writes the same bytes as FFmpeg’s encoder for all 80. The other files are only from that encoder (FFmpeg cannot write them): encrypted files with six passwords (1, 2 and 6 channels, 8, 16 and 24 bits), 1, 4, 12 and 20-bit headers, 9 to 20 channels, tags of every kind and combination, and a frame size that disagrees with the seek table, a hand-made TTA2 draft header, floating-point files (1 to 6 channels), 32-bit integer files, an audio-format-0 file, and 21 files of the 2003 TTA2 (levels 1 to 3, 8 to 24 bits and floats, 1 to 6 channels; written by a second research encoder). They decode to the original samples, and to FFmpeg’s wherever FFmpeg reads the file;
- text named
.tta, files cut at every few bytes and files with changed bytes: the viewer shows them without breaking.
The research encoder is written from the format’s rules, so for the files only it wrote the check shows that it and
the explorer agree with each other, and, where FFmpeg decodes them, with FFmpeg. For floating-point, 32-bit and 2003-TTA2 files no outside
decoder exists on this Mac (nothing downloaded was built or run), so those rest on the sources alone. Not covered by a real file: more than
two channels, 8-bit and 24-bit samples (FFmpeg’s encoder wrote the files that cover them), and any file made by the official
TTA tools other than luckynight.tta (whose origin is not stated).
Not described
These pages follow the format description of the codec’s authors (Tau Software), the source of ttaenc 3.2, 3.3, 3.4, 3.4.1 and dev 2.0, ttalib 1.1, libtta 2.1 to 2.3 and libttaR, FFmpeg’s encoder, decoder and demuxer, and the real files named above. The parts below are not covered or not confirmed.
Known, not yet covered
- Viewer: the waveform is not linked to bytes: frames differ in size, and the waveform’s link works only for equal blocks. The frames table and the tree link frames both ways.
- Viewer: the TTA2 draft’s header and footer are shown; its frames are not decoded (the draft does not say how they are coded).
- Viewer and reference: floating-point files (audio format 3, ttaenc 3.2 and 3.3), 32-bit integer files and the 2003 TTA2 of ttaenc-dev 2.0 are decoded and described from the public source of the tools that write them, but no real file of any of them is known and nothing downloaded was run: the test files come from a research encoder written from the same reading of the code (floats, dev 2.0).
- Viewer: the password of an encrypted file cannot be confirmed by the file: the one typed is used, or, with the box empty, the smoothest of a short list (why).
Unknown
- Reference: how the draft TTA2’s frames (the wiki’s layout with a channel mask) are coded, and whether any release used it (the draft).
- Reference: files of the Windows players’ TTA 1.x and 2.x, if they differ from TTA1: no source or file found after searching the SourceForge project (ttaenc 3.2 to 3.4.1, dev 2.0, ttalib 1.1, libtta 2.1 to 2.3), the GitHub mirrors, the Internet Archive copies of the authors’ site, FFmpeg and its test suite, and the MPlayer samples.
- Reference: how the official library would treat 4-byte or floating-point streams: it refuses them (24 bits at most).
Links
Software
- foobar2000 – free music player and converter (Windows, macOS, mobile)
- VLC media player – free player for almost any audio or video file (Windows, macOS, Linux, mobile)
- FFmpeg – command-line tool that converts TTA to and from other formats (Windows, macOS, Linux)