/** @packageDocumentation Audio properties for WavPack streams. Parses block headers including non-standard sample rates and DSD audio. */ import { AudioProperties } from "../audioProperties.js"; import type { offset_t, ReadStyle } from "../toolkit/types.js"; import type { File } from "../file.js"; /** Size of a WavPack block header in bytes. */ export declare const HeaderSize = 32; /** * Audio properties for WavPack streams. * * Supports standard and non-standard sample rates, hybrid (lossy) and * lossless modes, multi-channel configurations, and DSD audio. */ export declare class WavPackProperties extends AudioProperties { /** Playback duration in milliseconds. */ private _lengthInMs; /** Average bitrate in kilobits per second. */ private _bitrate; /** Sample rate in Hz. */ private _sampleRate; /** Number of audio channels accumulated across multi-block sequences. */ private _channels; /** WavPack stream version from the block header. */ private _version; /** Bits per sample (bit depth). */ private _bitsPerSample; /** `true` if the stream is lossless (hybrid flag not set). */ private _lossless; /** `true` if the stream contains DSD audio. */ private _dsd; /** Total number of PCM sample frames in the stream. */ private _sampleFrames; /** * Private constructor — use {@link WavPackProperties.create} to instantiate. * @param readStyle - Level of detail requested for property parsing. */ private constructor(); /** * Reads WavPack block headers from `file` and creates a populated properties instance. * @param file - The WavPack 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 WavPackProperties} instance. */ static create(file: File, 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; /** * WavPack stream version number read from the block header. * @returns The stream version (e.g. `0x407`). */ get version(): number; /** * Bits per sample (bit depth) of the audio stream. * @returns Bit depth (e.g. `16`, `24`, `32`). */ get bitsPerSample(): number; /** * Whether the stream is losslessly encoded. * @returns `true` for lossless, `false` for hybrid (lossy) mode. */ get isLossless(): boolean; /** * Whether the stream contains DSD (Direct Stream Digital) audio. * @returns `true` for DSD audio, `false` for standard PCM. */ get isDsd(): boolean; /** * Total number of PCM sample frames in the stream. * @returns Sample frame count. */ get sampleFrames(): number; /** * Walks WavPack block headers from the start of the file to populate all fields. * @param file - Open file handle positioned at byte 0. * @param streamLength - Byte length of the audio stream (excluding tags). */ private read; /** * Searches backward from `streamLength` for the last valid WavPack block * to determine the true total sample count when the header reports `0xFFFFFFFF`. * @param file - Open file handle. * @param streamLength - Byte offset to begin the backward search from. * @returns The total sample frame count, or `0` if it cannot be determined. */ private seekFinalIndex; } //# sourceMappingURL=wavpackProperties.d.ts.map