import { ByteVector } from "../byteVector"; import { ILosslessAudioCodec, MediaTypes } from "../properties"; /** * Implements {@link ILosslessAudioCodec} to provide support for reading Apple's AIFF stream * properties. */ export default class AiffStreamHeader implements ILosslessAudioCodec { /** * Identifier used to recognize an AIFF file. Although an AIFF file starts with "FORM2", we're * interested in the common chunk only, which contains the properties we need. */ static readonly FILE_IDENTIFIER: ByteVector; /** * Size of an AIFF common chunk in bytes */ static readonly SIZE = 26; private readonly _channels; private readonly _bitsPerSample; private readonly _sampleRate; private readonly _streamLength; private readonly _totalFrames; /** * Constructs and initializes a new instance of {@link AiffStreamHeader} for a specified header * block and stream length. * @param data Stream header data * @param streamLength Length of the AIFF audio stream in bytes */ constructor(data: ByteVector, streamLength: number); /** @inheritDoc */ get audioBitrate(): number; /** @inheritDoc */ get audioChannels(): number; /** @inheritDoc */ get audioSampleRate(): number; /** @inheritDoc */ get bitsPerSample(): number; /** @inheritDoc */ get description(): string; /** @inheritDoc */ get durationMilliseconds(): number; /** @inheritDoc */ get mediaTypes(): MediaTypes; }