/** @packageDocumentation Audio properties implementation for MPEG (MP3) and ADTS (AAC) files, including VBR (Xing/VBRI) support. */ import { AudioProperties } from "../audioProperties.js"; import { ReadStyle } from "../toolkit/types.js"; import { MpegVersion, ChannelMode } from "./mpegHeader.js"; import type { MpegFile } from "./mpegFile.js"; /** * Audio properties for MPEG (MP3) and ADTS (AAC) streams. * * Reads frame headers to determine duration, bitrate, sample rate and * channel layout. Handles both CBR and VBR (Xing / VBRI) streams. */ export declare class MpegProperties extends AudioProperties { /** Duration of the audio stream in milliseconds. */ private _lengthInMs; /** Average bitrate in kbps. */ private _bitrate; /** Sample rate in Hz. */ private _sampleRate; /** Number of audio channels. */ private _channels; /** MPEG version of the first audio frame. */ private _version; /** MPEG layer number (1, 2, or 3); 0 for ADTS. */ private _layer; /** Whether CRC protection is enabled. */ private _protectionEnabled; /** Whether the audio is flagged as copyrighted. */ private _isCopyrighted; /** Whether the audio is flagged as an original recording. */ private _isOriginal; /** Whether the stream is an ADTS (AAC) stream. */ private _isADTS; /** Channel mode of the first audio frame. */ private _channelMode; /** * Private constructor — use the static {@link MpegProperties.create} factory method. * @param readStyle - The read-style detail level passed to the base class. */ private constructor(); /** * Creates an `MpegProperties` instance by reading the audio stream from `file`. * * @param file - The MPEG file whose audio properties should be determined. * @param readStyle - The level of detail to use when scanning the stream (default: `ReadStyle.Average`). * @returns A fully populated `MpegProperties` instance. */ static create(file: MpegFile, readStyle?: ReadStyle): Promise; /** Gets the duration of the audio stream in milliseconds. */ get lengthInMilliseconds(): number; /** Gets the average audio bitrate in kbps. */ get bitrate(): number; /** Gets the audio sample rate in Hz. */ get sampleRate(): number; /** Gets the number of audio channels. */ get channels(): number; /** Gets the MPEG version of the first audio frame. */ get version(): MpegVersion; /** Gets the MPEG layer number (1, 2, or 3); 0 for ADTS streams. */ get layer(): number; /** Gets whether CRC protection is enabled. */ get protectionEnabled(): boolean; /** Gets whether the audio is flagged as copyrighted. */ get isCopyrighted(): boolean; /** Gets whether the audio is flagged as an original recording. */ get isOriginal(): boolean; /** Gets whether the stream is an ADTS (AAC) stream. */ get isADTS(): boolean; /** Gets the channel mode of the first audio frame. */ get channelMode(): ChannelMode; /** * Populates all property fields by scanning the audio frames in `file`. * Handles VBR (Xing/VBRI), ADTS, and CBR streams. * * @param file - The MPEG file to read audio data from. */ private read; /** * Scans ADTS frames to compute an average bitrate, then derives the stream duration. * * @param file - The MPEG file being analysed. * @param firstOffset - Byte offset of the first ADTS frame. * @param firstHeader - The parsed header of the first ADTS frame. */ private readADTS; /** * Calculates the stream duration from the byte extents between the first and * last valid frames using the already-computed bitrate. * * @param file - The MPEG file being analysed. * @param firstOffset - Byte offset of the first valid frame. * @param _firstHeader - The first frame header (reserved for future use). */ private computeLength; } //# sourceMappingURL=mpegProperties.d.ts.map