/** @packageDocumentation Audio properties for Musepack (MPC) streams. Parses SV4–SV8 headers. */ import { AudioProperties } from "../audioProperties.js"; import { ByteVector } from "../byteVector.js"; import type { offset_t, ReadStyle } from "../toolkit/types.js"; import type { MpcFile } from "./mpcFile.js"; /** MPC header size for SV7 and earlier: 8 × 7 = 56 bytes. */ export declare const MPC_HEADER_SIZE: number; /** * Audio properties for Musepack (MPC) streams. * * Supports SV4 through SV8 stream versions. SV8 uses a containerized * packet format ("MPCK" magic); SV7 uses a fixed header ("MP+" magic); * SV4/SV5 use an older legacy header. */ export declare class MpcProperties extends AudioProperties { /** MPC stream version (e.g. 7 for SV7, 8 for SV8). */ 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; /** Total number of frames in the stream (SV7 and earlier). */ private _totalFrames; /** Total number of PCM sample frames (net of encoder/decoder delay). */ private _sampleFrames; /** Track replay gain value (raw; convert to dB: `64.82 - trackGain / 256`). */ private _trackGain; /** Track peak level (raw; convert to dB: `trackPeak / 256`). */ private _trackPeak; /** Album replay gain value (raw; convert to dB: `64.82 - albumGain / 256`). */ private _albumGain; /** Album peak level (raw; convert to dB: `albumPeak / 256`). */ private _albumPeak; /** * Private constructor — use {@link MpcProperties.create} to instantiate. * @param readStyle - Level of detail requested for property parsing. */ private constructor(); /** * Reads the magic bytes from the current stream position and delegates to * {@link readSV8} (if the "MPCK" header is found) or {@link readSV7} otherwise. * @param file - The MPC file positioned at the start of the audio stream. * @param streamLength - Byte length of the audio stream (excluding tags). * @param readStyle - Level of detail for property parsing. * @returns A fully populated {@link MpcProperties} instance. */ static create(file: MpcFile, streamLength: offset_t, readStyle: ReadStyle): Promise; /** * 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; /** * Musepack stream version number (e.g. `7` for SV7, `8` for SV8). * @returns The stream version, or `0` if not yet determined. */ get mpcVersion(): number; /** * Total number of frames in the stream (SV7 and earlier only). * @returns Frame count, or `0` for SV8 streams. */ get totalFrames(): number; /** * Net number of PCM sample frames after subtracting encoder/decoder delay. * @returns Sample frame count. */ get sampleFrames(): number; /** Track gain (to dB: `64.82 - trackGain / 256`). */ get trackGain(): number; /** Track peak (to dB: `trackPeak / 256`). */ get trackPeak(): number; /** Album gain (to dB: `64.82 - albumGain / 256`). */ get albumGain(): number; /** Album peak (to dB: `albumPeak / 256`). */ get albumPeak(): number; /** * Parses audio properties from an SV8 ("MPCK") packet stream. * Reads "SH" (Stream Header) and "RG" (Replay Gain) packets, stopping * at the "SE" (Stream End) packet or on read error. * @param file - The MPC file positioned immediately after the "MPCK" magic. * @param streamLength - Byte length of the audio data (excluding tags). * @internal */ readSV8(file: MpcFile, streamLength: offset_t): Promise; /** * Parses audio properties from an SV7 ("MP+") or legacy SV4/SV5 fixed-size header. * @param data - The raw header bytes (at least {@link MPC_HEADER_SIZE} bytes). * @param streamLength - Byte length of the audio data (excluding tags). * @internal */ readSV7(data: ByteVector, streamLength: offset_t): void; } //# sourceMappingURL=mpcProperties.d.ts.map