/** @packageDocumentation Audio properties implementation for the Monkey's Audio (APE) format. */ import { AudioProperties } from "../audioProperties.js"; import type { offset_t, ReadStyle } from "../toolkit/types.js"; import type { File } from "../file.js"; /** * Audio properties for Monkey's Audio (APE) streams. * * Supports both current (v3980+) and legacy header formats. Current * versions use a 44-byte descriptor followed by a 24-byte header; older * versions use a 26-byte header with embedded WAV format info. */ export declare class ApeProperties extends AudioProperties { /** APE format version (e.g. 3990, 3980, 3800). */ private _version; /** Duration of the stream in milliseconds. */ private _lengthInMs; /** Average bitrate in kb/s. */ 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; /** * @param readStyle - Level of detail to use when reading properties. */ private constructor(); /** * Asynchronously create and populate an {@link ApeProperties} instance by * reading from `file`. * * @param file - The file to read from (positioned at or near the APE header). * @param streamLength - Byte length of the audio stream, used to compute bitrate. * @param readStyle - Level of detail to use when reading properties. * @returns A resolved promise containing the populated properties object. */ static create(file: File, streamLength: offset_t, readStyle: ReadStyle): Promise; /** Duration of the audio stream in milliseconds. */ get lengthInMilliseconds(): number; /** Average bitrate of the stream in kb/s. */ get bitrate(): number; /** Sample rate of the stream in Hz. */ get sampleRate(): number; /** Number of audio channels. */ get channels(): number; /** APE format version number (e.g. 3990 for v3.99). */ get version(): number; /** Bits per sample (bit depth) of the audio stream. */ get bitsPerSample(): number; /** Total number of PCM sample frames in the stream. */ get sampleFrames(): number; /** * Locate the APE descriptor/header in `file` and populate all fields. * * @param file - Open file handle to read from. * @param streamLength - Length of the raw audio stream in bytes. */ private read; /** * Extract the APE version number from a 6-byte header block. * * @param header - Six bytes starting with the "MAC " identifier. * @returns The 16-bit version field, or `-1` if the block is not a valid APE header. */ private headerVersion; /** * Parse the current (v3980+) format: 44-byte descriptor + 24-byte header. */ private analyzeCurrent; /** * Parse older (pre-3980) format: 26-byte header + WAV fmt chunk. */ private analyzeOld; } //# sourceMappingURL=apeProperties.d.ts.map