node-taglib-sharp / Exports / 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".
-
default
↳
MpegXingHeader
• get
bitrateKilobytes(): number
Gets the bitrate of the ile in kilobytes per second, if it could be calculated using the
current instance. undefined
, otherwise.
number
VbrHeader.bitrateKilobytes
• get
durationMilliseconds(): number
Gets the duration of the file in milliseconds, if it could be calculated using the current
instance. undefined
, otherwise.
number
VbrHeader.durationMilliseconds
• get
totalBytes(): number
Gets the total size of the file in bytes, as indicated by the current instance.
number
VbrHeader.totalBytes
• get
totalFrames(): number
Gets the total number of frames in the file, as indicated by the current instance.
number
VbrHeader.totalFrames
▸ Static
fromFile(file
, mpegHeaderPosition
, mpegVersion
, mpegChannelMode
, samplesPerFrame
, samplesPerSecond
, fallbackFileSize
): MpegXingHeader
Name | Type |
---|---|
file |
File |
mpegHeaderPosition |
number |
mpegVersion |
MpegVersion |
mpegChannelMode |
MpegAudioChannelMode |
samplesPerFrame |
number |
samplesPerSecond |
number |
fallbackFileSize |
number |