taglib-ts
    Preparing search index...

    Audio properties for MPEG (MP3) and ADTS (AAC) streams.

    Reads frame headers to determine duration, bitrate, sample rate and channel layout. Handles both CBR and VBR (Xing / VBRI) streams.

    Hierarchy (View Summary)

    Index

    Properties

    _readStyle: ReadStyle

    The read style used when parsing the audio stream.

    Accessors

    • get bitrate(): number

      Gets the average audio bitrate in kbps.

      Returns number

    • get channels(): number

      Gets the number of audio channels.

      Returns number

    • get isCopyrighted(): boolean

      Gets whether the audio is flagged as copyrighted.

      Returns boolean

    • get isOriginal(): boolean

      Gets whether the audio is flagged as an original recording.

      Returns boolean

    • get layer(): number

      Gets the MPEG layer number (1, 2, or 3); 0 for ADTS streams.

      Returns number

    • get lengthInMilliseconds(): number

      Gets the duration of the audio stream in milliseconds.

      Returns number

    • get lengthInSeconds(): number

      Duration rounded to the nearest second.

      Returns number

    • get sampleRate(): number

      Gets the audio sample rate in Hz.

      Returns number

    Methods

    • Creates an MpegProperties instance by reading the audio stream from file.

      Parameters

      • file: MpegFile

        The MPEG file whose audio properties should be determined.

      • readStyle: ReadStyle = ReadStyle.Average

        The level of detail to use when scanning the stream (default: ReadStyle.Average).

      Returns Promise<MpegProperties>

      A fully populated MpegProperties instance.