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: