import IOggCodec from "./iOggCodec"; import XiphComment from "../../xiph/xiphComment"; import { ByteVector } from "../../byteVector"; import { IAudioCodec, MediaTypes } from "../../properties"; /** * Represents an Ogg Vorbis bitstream for use in an Ogg file. */ export default class Vorbis implements IOggCodec, IAudioCodec { private static readonly IDENTIFIER; private readonly _bitrateMaximum; private readonly _bitrateMinimum; private readonly _bitrateNominal; private readonly _channels; private readonly _sampleRate; private readonly _vorbisVersion; private _commentData; private _durationMilliseconds; /** * Constructs and initializes a new instance using the provided header packet. * @param headerPacket Packet that contains the Vorbis header data */ constructor(headerPacket: ByteVector); /** * @inheritDoc * @remarks * For Vorbis files, this is the nominal bitrate as specified in the identification * header. This may be significantly different from the actual average since this header * only provides decoding hints. */ get audioBitrate(): number; /** @inheritDoc */ get audioChannels(): number; /** @inheritDoc */ get audioSampleRate(): number; /** * Gets the raw Xiph comment data contained in the codec. */ get commentData(): ByteVector; /** @inheritDoc */ get description(): string; /** @inheritDoc */ get durationMilliseconds(): number; /** @inheritDoc */ get mediaTypes(): MediaTypes; /** * Determines if a packet is a Vorbis header packet. * @param packet Packet to check */ static isHeaderPacket(packet: ByteVector): boolean; /** @inheritDoc */ readPacket(packet: ByteVector): boolean; /** @inheritDoc */ setDuration(firstGranularPosition: ByteVector, lastGranularPosition: ByteVector): void; /** @inheritDoc */ writeCommentPacket(packets: ByteVector[], comment: XiphComment): void; }