|
| TTA Lossless Audio Codec :: Format Description |
Detailed description of the TTA multichannel audio data format. Simple and stable lossless audio data format for real-time compressing of digital music. Free and fully-functional for any use.
TTA lossless audio data format has a very simple structure. The TTA file header contains a unique format identifier, which is followed by two meta-data blocks.
The first block contains minimal information which is needed for restoring the original stream (including number of channels, count of bits per sample, sample rate and overall number of samples in file).
Block two contains the TTA seek points table. Each data block is ended by a 32-bit control sum. The seek table must have a number of seek-points equal to the number of frames in the stream. Each seek-point uses 4 bytes and contains the current frame data length in bytes. It is possible to decode TTA file with a corrupted seek table, but in "unseekable" mode only.
Following that header, we write the encoding residue.
TTA Header Structure
| Byte Number | Value |
| 00-03 | Format signature with major version number (ASCII) |
| 04-05 | Audio format (binary, Little Endian) |
| 06-07 | Number of channels (binary, Little Endian) |
| 08-09 | Bits per sample (binary, Little Endian) |
| 10-13 | Sample rate (binary, Little Endian) |
| 14-17 | Data length in samples (binary, Little Endian) |
| 18-21 | CRC32 block footer (binary, Little Endian) |
| 22-25 | Seek point (binary, Little Endian) |
| 26-XX | .. .. .. .. .. .. .. .. .. .. .. .. .. .. |
| YY-ZZ | CRC32 block footer (binary, Little Endian) |
The audio data are composed of one or more audio frames. Each frame is ended by a 32-bit control sum; a decoder may start decoding from any frame in the stream. The compressed samples of channels in a frame are located sequentially, as in a simple PCM data format.
TTA Frame Structure
| Byte Number | Value |
| 00-XX | Frame data (bit stream) |
| YY-ZZ | CRC32 frame footer (binary, Little Endian) |
The frame duration in the TTA format is fixed at about one second. Therefore, every frame in a stream has an equal count of samples, except for the last. The sample count in a TTA frame is a multiple to 576 (sound buffer granule), and determined as:
frame length = frame time * sample rate
,where "frame time" is a constant 1.04489795918367346939. The total number of frames in data stream can be calculated as a quotient of overall count of samples and "frame length". TTA format supports both of ID3v1/v2 tags.
|
|
|