node-taglib-sharp / Exports / OggVorbisCodec
Represents an Ogg Vorbis bitstream for use in an Ogg file.
• new OggVorbisCodec(headerPacket
)
Constructs and initializes a new instance using the provided header packet.
Name | Type | Description |
---|---|---|
headerPacket |
ByteVector |
Packet that contains the Vorbis header data |
• get
audioBitrate(): number
Bitrate of the audio in kilobits per second represented by the current instance.
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.
number
• get
audioChannels(): number
Number of channels in the audio represented by the current instance.
number
• get
audioSampleRate(): number
Sample rate of the audio represented by the current instance.
number
• get
commentData(): ByteVector
Gets the raw Xiph comment data contained in the codec.
IOggCodec.commentData
• get
description(): string
Gets a text description of the media represented by the current instance.
string
• get
durationMilliseconds(): number
Duration of the media in milliseconds represented by the current instance.
number
IAudioCodec.durationMilliseconds
• get
mediaTypes(): MediaTypes
Types of media represented by the current instance, bitwise combined.
▸ readPacket(packet
): boolean
Reads an Ogg packet that has been encountered in the stream, looking for the comment data.
Name | Type | Description |
---|---|---|
packet |
ByteVector |
Packet to read |
boolean
▸ 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.
Name | Type | Description |
---|---|---|
firstGranularPosition |
ByteVector |
First granular position of the stream |
lastGranularPosition |
ByteVector |
Last granular position of the stream |
void
▸ writeCommentPacket(packets
, comment
): void
Renders and write the provided comment into the provided list of packets.
Name | Type | Description |
---|---|---|
packets |
ByteVector [] |
List of packets the comment packet should be written into. |
comment |
XiphComment |
Xiph comment to write into the list of packets. |
void
▸ Static
isHeaderPacket(packet
): boolean
Determines if a packet is a Vorbis header packet.
Name | Type | Description |
---|---|---|
packet |
ByteVector |
Packet to check |
boolean