/** @packageDocumentation Xing and VBRI VBR header parser for MPEG audio files, used to determine total frame count and stream size. */ import { ByteVector } from "../byteVector.js"; /** * Identifies the type of VBR header found in the first MPEG frame. */ export declare enum XingHeaderType { /** No valid VBR header was found. */ Invalid = 0, /** A Xing or Info VBR header was found. */ Xing = 1, /** A VBRI VBR header (Fraunhofer) was found. */ VBRI = 2 } /** * Parser for Xing and VBRI VBR headers found inside the first MPEG frame. */ export declare class XingHeader { /** The type of VBR header detected. */ private _type; /** Total number of MPEG frames in the stream, as reported by the VBR header. */ private _totalFrames; /** Total byte size of the audio stream, as reported by the VBR header. */ private _totalSize; /** * Constructs an `XingHeader` by attempting to parse a Xing/Info or VBRI * header from the first frame's data. * * @param data - The raw bytes of the first MPEG audio frame (header + side information + payload). */ constructor(data: ByteVector); /** * Gets whether this is a valid, usable VBR header (type is not `Invalid` * and both `totalFrames` and `totalSize` are non-zero). */ get isValid(): boolean; /** Gets the total number of MPEG frames in the stream. */ get totalFrames(): number; /** Gets the total byte size of the audio data. */ get totalSize(): number; /** Gets the type of VBR header detected (`Xing`, `VBRI`, or `Invalid`). */ get type(): XingHeaderType; /** * Attempts to locate and parse a Xing/Info or VBRI header in `data`. * @param data - The first MPEG frame's raw bytes. */ private parse; /** * Parses a Xing or Info VBR header starting at `offset` within `data`. * Both the frame-count flag (0x01) and the size flag (0x02) must be set. * * @param data - The first MPEG frame's raw bytes. * @param offset - Byte offset of the "Xing"/"Info" magic within `data`. */ private parseXing; /** * Parses a VBRI (Fraunhofer) VBR header starting at `offset` within `data`. * The total size is read at offset+10 and total frames at offset+14. * * @param data - The first MPEG frame's raw bytes. * @param offset - Byte offset of the "VBRI" magic within `data`. */ private parseVBRI; } //# sourceMappingURL=xingHeader.d.ts.map