Class: OggTheoraCodec

October 29, 2023 · View on GitHub

node-taglib-sharp / Exports / OggTheoraCodec

Class: OggTheoraCodec

Represents an Ogg Theora bitstream for use in an Ogg file.

Implements

Table of contents

Constructors

Accessors

Methods

Constructors

constructor

new OggTheoraCodec(headerPacket)

Constructs and initializes a new instance using the provided header packet.

Parameters

NameTypeDescription
headerPacketByteVectorPacket that contains the Theora header data

Accessors

commentData

get commentData(): ByteVector

Gets the raw Xiph comment data contained in the codec.

Returns

ByteVector

Implementation of

IOggCodec.commentData


description

get description(): string

Gets a text description of the media represented by the current instance.

Returns

string

Implementation of

IVideoCodec.description


durationMilliseconds

get durationMilliseconds(): number

Duration of the media in milliseconds represented by the current instance.

Returns

number

Implementation of

IVideoCodec.durationMilliseconds


mediaTypes

get mediaTypes(): MediaTypes

Types of media represented by the current instance, bitwise combined.

Returns

MediaTypes

Implementation of

IVideoCodec.mediaTypes


videoHeight

get videoHeight(): number

Height of the video in pixels represented by the current instance.

Returns

number

Implementation of

IVideoCodec.videoHeight


videoWidth

get videoWidth(): number

Width of the video in pixels represented by the current instance.

Returns

number

Implementation of

IVideoCodec.videoWidth

Methods

readPacket

readPacket(packet): boolean

Reads an Ogg packet that has been encountered in the stream, looking for the comment data.

Parameters

NameTypeDescription
packetByteVectorPacket to read

Returns

boolean

Implementation of

IOggCodec.readPacket


setDuration

setDuration(firstGranularPosition, lastGranularPosition): void

Sets the file offset information necessary for calculating the duration of the stream. Once called, the duration can be accessed by calling durationMilliseconds.

Parameters

NameTypeDescription
firstGranularPositionByteVectorFirst granular position of the stream
lastGranularPositionByteVectorLast granular position of the stream

Returns

void

Implementation of

IOggCodec.setDuration


writeCommentPacket

writeCommentPacket(packets, comment): void

Renders and write the provided comment into the provided list of packets.

Parameters

NameTypeDescription
packetsByteVector[]List of packets the comment packet should be written into.
commentXiphCommentXiph comment to write into the list of packets.

Returns

void

Implementation of

IOggCodec.writeCommentPacket


isHeaderPacket

Static isHeaderPacket(packet): boolean

Checks to see if packet is a Theora header packet.

Parameters

NameTypeDescription
packetByteVectorPacket to check

Returns

boolean