/** @packageDocumentation Audio properties for TrueAudio (TTA) streams. Parses the 18-byte TTA1 header. */ import { AudioProperties } from "../audioProperties.js"; import { ByteVector } from "../byteVector.js"; import type { offset_t, ReadStyle } from "../toolkit/types.js"; /** * Size of the TTA1 header in bytes: * `"TTA"` (3) + version (1) + format (2) + channels (2) + * bitsPerSample (2) + sampleRate (4) + sampleFrames (4) = 18 bytes. */ export declare const TTA_HEADER_SIZE = 18; /** * Audio properties for TrueAudio (TTA) streams. * * Parses the 18-byte TTA1 header: `"TTA"` + version byte + audio format (2) + * channels (2) + bitsPerSample (2) + sampleRate (4) + sampleFrames (4). */ export declare class TrueAudioProperties extends AudioProperties { /** TTA stream version number (e.g. `1` for TTA1). */ private _version; /** Playback duration in milliseconds. */ private _lengthInMs; /** Average bitrate in kilobits per second. */ private _bitrate; /** Sample rate in Hz. */ private _sampleRate; /** Number of audio channels. */ private _channels; /** Bits per sample (bit depth). */ private _bitsPerSample; /** Total number of PCM sample frames. */ private _sampleFrames; /** * Constructs a {@link TrueAudioProperties} instance by parsing the TTA1 header. * @param data - Raw bytes beginning with `"TTA"` (must be at least {@link TTA_HEADER_SIZE} bytes for TTA1). * @param streamLength - Byte length of the audio stream (excluding tags), used to compute bitrate. * @param readStyle - Level of detail for property parsing. */ constructor(data: ByteVector, streamLength: offset_t, readStyle: ReadStyle); /** * Playback duration in milliseconds. * @returns Duration in milliseconds, or `0` if unknown. */ get lengthInMilliseconds(): number; /** * Average bitrate of the stream in kilobits per second. * @returns Bitrate in kbps, or `0` if unknown. */ get bitrate(): number; /** * Sample rate of the audio stream in Hz. * @returns Sample rate in Hz, or `0` if unknown. */ get sampleRate(): number; /** * Number of audio channels. * @returns Channel count (e.g. `2` for stereo). */ get channels(): number; /** * TrueAudio stream version number. * @returns The version (e.g. `1` for TTA1). */ get ttaVersion(): number; /** * Bits per sample (bit depth) of the audio stream. * @returns Bit depth (e.g. `16`, `24`). */ get bitsPerSample(): number; /** * Total number of PCM sample frames in the stream. * @returns Sample frame count. */ get sampleFrames(): number; /** * Parses the TTA1 header bytes and populates all audio property fields. * @param data - Raw header bytes starting with `"TTA"`. * @param streamLength - Byte length of the audio stream (excluding tags). */ private read; } //# sourceMappingURL=trueAudioProperties.d.ts.map