import { ByteVector } from "../byteVector"; import { IAudioCodec, ILosslessAudioCodec, MediaTypes } from "../properties"; /** * Indicates the compression level used when encoding a Monkey's Audio APE file */ export declare enum ApeCompressionLevel { /** * Audio is not compressed */ None = 0, /** * Audio is mildly compressed */ Fast = 1000, /** * Audio is compressed at a normal level */ Normal = 2000, /** * Audio is highly compressed */ High = 3000, /** * Audio is extremely highly compressed */ ExtraHigh = 4000, /** * Audio is compressed to an insane level */ Insane = 5000 } /** * Provides support for reading Monkey's Audio APE stream properties. */ export declare class ApeStreamHeader implements IAudioCodec, ILosslessAudioCodec { /** * Identifier used to recognize a Monkey's Audio file */ static readonly FILE_IDENTIFIER: ByteVector; /** * Size of a Monkey Audio Header */ static readonly SIZE = 76; /** * Contains the number of bits per sample, stored in bytes (67-68) and is typically 16. * @private */ private readonly _bitsPerSample; /** * Number of audio blocks in one frame, stored in bytes (55-58). * @private */ private readonly _blocksPerFrame; /** * Number of channels, stored in bytes (69,70) and is typically 1 or 2. * @private */ private readonly _channels; private readonly _compression; /** * Contains the num,ber of audio blocks in the final frame, stored in bytes (59-62) * @private */ private readonly _finalFrameBlocks; /** * Contains the sample rate, stored in bytes (71-74) and is typically 44100. * @private */ private readonly _sampleRate; /** * Contains the length of the audio stream * @private */ private readonly _streamLength; /** * Total number of frames, stored in bytes (63-66) * @private */ private readonly _totalFrames; /** * APE version stored in bytes (4,5) of the file and is 1000 times the actual version, so 3810 * indicates version 3.81. * @private */ private readonly _version; /** * Constructs and initializes a new {@link ApeStreamHeader} from a raw header block and stream * length. * @param data Raw stream header data beginning with {@link ApeStreamHeader.FILE_IDENTIFIER} * @param streamLength Length of the stream in bytes */ constructor(data: ByteVector, streamLength: number); /** @inheritDoc */ get audioBitrate(): number; /** @inheritDoc */ get audioChannels(): number; /** @inheritDoc */ get audioSampleRate(): number; /** @inheritDoc */ get bitsPerSample(): number; /** * Gets the level of compression used when encoding the audio represented by the current * instance */ get compressionLevel(): ApeCompressionLevel; /** @inheritDoc */ get description(): string; /** @inheritDoc */ get durationMilliseconds(): number; /** @inheritDoc */ get mediaTypes(): MediaTypes; /** * Gets the APE version of the audio represented by the current instance */ get version(): number; }