JSPM

@synesthesia-project/gapless-meta

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q30428F
  • License MIT

Library for parsing gapless padding metadata for audiofiles to enable gapless playback

Package Exports

  • @synesthesia-project/gapless-meta

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@synesthesia-project/gapless-meta) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gapless-meta

This library is designed to extract metadata from audiofiles to allow for gapless playback (for example, in browser-based media players), but also extracts some other standard metadata.

Audio file support

The following audio formats are supported, and are part of the test suite:

  • MP3 files
    • Encoded by LAME or libavformat (Lavf)
    • With or without ID3v2 tags.

Installation

npm install @synesthesia-project/gapless-meta

Usage

import getMetadata from '@synesthesia-project/gapless-meta';

const buffer = ... // (some ArrayBuffer)
const metadata = getMetadata(buffer.buffer);
console.log(metadata);

Output:

{
  version: '1',
  layer: '3',
  bitrate: 128,
  mode: 'joint_stereo',
  sampleRate: 44100,
  samplesPerFrame: 1152,
  vbrInfo: {
    isCBR: true,
    numberOfFrames: 185,
  },
  lameInfo: {
    encoder: 'LAME3.100',
    paddingStart: 576,
    paddingEnd: 1058
  }
}

(For extensive examples of usage, see the tests).

TODO

  • MP3
    • CRC Verification
    • Support APEv2 tags at start of audio files
    • Support more encoders
    • Support MPEG Layer 1
  • MP4 AAC Support

Inspiration

This library is inspired and informed by a number of documents, blog posts and specifications, including: