Class: OggCodecFactory

March 10, 2023 · View on GitHub

node-taglib-sharp / Exports / OggCodecFactory

Class: OggCodecFactory

Factory for creating codecs from the first packet of the Ogg bitstream.

Remarks

By default, only codecs provided by the library will be matched. However, custom codec support can be added by using addCodecProvider.

Table of contents

Constructors

Methods

Constructors

constructor

new OggCodecFactory()

Methods

addCodecProvider

Static addCodecProvider(provider): void

Adds a custom codec provider to try before using standard codec creation methods. Codec providers are used before standard methods so custom checking can be used and new formats can be added. They are executed in reverse order in which they are added.

Parameters

NameTypeDescription
providerOggCodecProviderCodec provider function * firstPacket: ByteVector First packet of the bitstream * returns IOggCodec if method was able to match the packet, falsy otherwise

Returns

void


clearCustomProviders

Static clearCustomProviders(): void

Clears the custom providers from the factory.

Returns

void


getCodec

Static getCodec(packet): IOggCodec

Determines the correc codec to use for a stream header packet.

Parameters

NameTypeDescription
packetByteVectorFirst packet of an Ogg logical bitstream.

Returns

IOggCodec