import VbrHeader from "./vbrHeader"; import { File } from "../file"; import { ChannelMode, MpegVersion } from "./mpegEnums"; /** * 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". */ export default class XingHeader extends VbrHeader { private static readonly IDENTIFIER_CBR; private static readonly IDENTIFIER_LAME; private static readonly IDENTIFIER_VBR; private static readonly LAME_HEADER_LENGTH; private static readonly XING_HEADER_LENGTH; private constructor(); static fromFile(file: File, mpegHeaderPosition: number, mpegVersion: MpegVersion, mpegChannelMode: ChannelMode, samplesPerFrame: number, samplesPerSecond: number, fallbackFileSize: number): XingHeader | undefined; }