Class: MpegXingHeader
November 25, 2024 · View on GitHub
node-taglib-sharp / Exports / MpegXingHeader
Class: MpegXingHeader
Information about a Xing variable bitrate MPEG audio stream. This provides a much more accurate determination of bitrate and duration than just using the first MPEG frame header alone.
Remarks
There is a tiny, known bug in this implementation. According to Hydrogenaudio, for LAME v3.99.1, they tried to change the version string to start with L instead of LAME. This was rolled back in v3.99.2 due to backwards compat issues with decoders. However, to simplify the code here, I've just decided to only check for LAME. Thus, for files encoded with this broken version of LAME (or indeed with other encoders like Gogo), the file bitrate and duration will be slightly inaccurate. Please raise a GitHub issue if this is not good enough and make sure to say "I told you not to half-ass it, Ben".
Hierarchy
-
default↳
MpegXingHeader
Table of contents
Accessors
Methods
Accessors
bitrateKilobytes
• get bitrateKilobytes(): number
Gets the bitrate of the ile in kilobytes per second, if it could be calculated using the
current instance. undefined, otherwise.
Returns
number
Inherited from
VbrHeader.bitrateKilobytes
durationMilliseconds
• get durationMilliseconds(): number
Gets the duration of the file in milliseconds, if it could be calculated using the current
instance. undefined, otherwise.
Returns
number
Inherited from
VbrHeader.durationMilliseconds
totalBytes
• get totalBytes(): number
Gets the total size of the file in bytes, as indicated by the current instance.
Returns
number
Inherited from
VbrHeader.totalBytes
totalFrames
• get totalFrames(): number
Gets the total number of frames in the file, as indicated by the current instance.
Returns
number
Inherited from
VbrHeader.totalFrames
Methods
fromFile
▸ Static fromFile(file, mpegHeaderPosition, mpegVersion, mpegChannelMode, samplesPerFrame, samplesPerSecond, fallbackFileSize): MpegXingHeader
Parameters
| Name | Type |
|---|---|
file | File |
mpegHeaderPosition | number |
mpegVersion | MpegVersion |
mpegChannelMode | MpegAudioChannelMode |
samplesPerFrame | number |
samplesPerSecond | number |
fallbackFileSize | number |