taglib-ts
    Preparing search index...

    Audio properties parsed from an AIFF/AIFC COMM chunk.

    COMM chunk layout (big-endian): channels(2) + sampleFrames(4) + bitsPerSample(2)

    • sampleRate(10 bytes, IEEE 754 80-bit extended float)

    For AIFC, additionally:

    • compressionType(4) + compressionName(Pascal string)

    Hierarchy (View Summary)

    Index

    Constructors

    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. Matches the C++ calculation: trunc(streamLength * 8 / preciseLength + 0.5).

      Returns number

      Bitrate in kbps, or 0 if duration is zero.

    • get bitsPerSample(): number

      Bits per sample (bit depth) of the audio stream.

      Returns number

      Bit depth (e.g. 16, 24).

    • get channels(): number

      Number of audio channels.

      Returns number

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

    • get compressionName(): string

      Human-readable compression name from the Pascal string in the COMM chunk (AIFC only).

      Returns string

      The compression name string, or "" for plain AIFF.

    • get compressionType(): string

      Four-character compression type identifier (AIFC only). Common values: "NONE" (uncompressed), "sowt" (little-endian PCM), "fl32".

      Returns string

      The compression type string, or "" for plain AIFF.

    • get isAifc(): boolean

      Whether this is an AIFC file (the COMM chunk contains a compression type field).

      Returns boolean

      true for AIFC, false for plain AIFF.

    • get lengthInMilliseconds(): number

      Playback duration in milliseconds, derived from sampleFrames and sampleRate.

      Returns number

      Duration in milliseconds, or 0 if sampleRate is zero.

    • get lengthInSeconds(): number

      Duration rounded to the nearest second.

      Returns number

    • get sampleFrames(): number

      Total number of PCM sample frames in the "SSND" chunk.

      Returns number

      Sample frame count.

    • get sampleRate(): number

      Sample rate of the audio stream in Hz (rounded to the nearest integer).

      Returns number

      Sample rate in Hz, or 0 if unknown.