taglib-ts
    Preparing search index...

    Audio properties for Musepack (MPC) streams.

    Supports SV4 through SV8 stream versions. SV8 uses a containerized packet format ("MPCK" magic); SV7 uses a fixed header ("MP+" magic); SV4/SV5 use an older legacy header.

    Hierarchy (View Summary)

    Index

    Properties

    _readStyle: ReadStyle

    The read style used when parsing the audio stream.

    Accessors

    • get bitrate(): number

      Average bitrate of the stream in kilobits per second.

      Returns number

      Bitrate in kbps, or 0 if unknown.

    • get channels(): number

      Number of audio channels.

      Returns number

      Channel count (e.g. 2 for stereo).

    • get lengthInMilliseconds(): number

      Playback duration in milliseconds.

      Returns number

      Duration in milliseconds, or 0 if unknown.

    • get lengthInSeconds(): number

      Duration rounded to the nearest second.

      Returns number

    • get mpcVersion(): number

      Musepack stream version number (e.g. 7 for SV7, 8 for SV8).

      Returns number

      The stream version, or 0 if not yet determined.

    • get sampleFrames(): number

      Net number of PCM sample frames after subtracting encoder/decoder delay.

      Returns number

      Sample frame count.

    • get sampleRate(): number

      Sample rate of the audio stream in Hz.

      Returns number

      Sample rate in Hz, or 0 if unknown.

    • get totalFrames(): number

      Total number of frames in the stream (SV7 and earlier only).

      Returns number

      Frame count, or 0 for SV8 streams.

    Methods

    • Internal

      Parses audio properties from an SV7 ("MP+") or legacy SV4/SV5 fixed-size header.

      Parameters

      • data: ByteVector

        The raw header bytes (at least MPC_HEADER_SIZE bytes).

      • streamLength: number

        Byte length of the audio data (excluding tags).

      Returns void

    • Internal

      Parses audio properties from an SV8 ("MPCK") packet stream. Reads "SH" (Stream Header) and "RG" (Replay Gain) packets, stopping at the "SE" (Stream End) packet or on read error.

      Parameters

      • file: MpcFile

        The MPC file positioned immediately after the "MPCK" magic.

      • streamLength: number

        Byte length of the audio data (excluding tags).

      Returns Promise<void>

    • Reads the magic bytes from the current stream position and delegates to readSV8 (if the "MPCK" header is found) or readSV7 otherwise.

      Parameters

      • file: MpcFile

        The MPC file positioned at the start of the audio stream.

      • streamLength: number

        Byte length of the audio stream (excluding tags).

      • readStyle: ReadStyle

        Level of detail for property parsing.

      Returns Promise<MpcProperties>

      A fully populated MpcProperties instance.