flac-metadata
A FLAC metadata processor for Node.js, implemented as Transform stream.
Installation
npm install flac-metadata
Usage Examples
Some simple examples to get you started:
Noop
Does nothing, just pipes a source FLAC through the Processor into a target FLAC.
var fs = ;var flac = ; var reader = fs;var writer = fs;var processor = ; reader;
Trace Metadata
Traces out the metadata from a FLAC file.
var fs = ;var flac = ; var reader = fs;var processor = parseMetaDataBlocks: true ;processor; reader;
The output should be something like this:
[MetaDataBlockStreamInfo] type: 0, isLast: false
minBlockSize: 4096
maxBlockSize: 4096
minFrameSize: 14
maxFrameSize: 12389
samples: 9750804
sampleRate: 44100
channels: 2
bitsPerSample: 16
duration: 3:41.107
checksum: 1746dff27beb6d1875a88cfeed8a576b
[MetaDataBlockVorbisComment] type: 4, isLast: false
vendor: reference libFLAC 1.2.1 20070917
comments:
ALBUM: Close to the Glass
ARTIST: The Notwist
GENRE: Rock
DATE: 2014
TITLE: Signals
[MetaDataBlockPicture] type: 6, isLast: true
pictureType: 3
mimeType: image/png
description:
width: 120
height: 120
bitsPerPixel: 32
colors: 0
pictureData: 391383
Strip All Metadata
Pipes a source FLAC through the Processor into a target FLAC, removing all metadata.
var fs = ;var flac = ; var reader = fs;var writer = fs;var processor = ; processor; reader;
Inject Metadata
Injects a VORBIS_COMMENT block (and removes the existing one, if any).
var fs = ;var flac = ; var reader = fs;var writer = fs;var processor = ; var mdbVorbis;var vendor = "reference libFLAC 1.2.1 20070917";var comments = "ARTIST=Boyracer" "TITLE=I've Got It And It's Not Worth Having" "ALBUM=B Is For Boyracer" "TRACKNUMBER=A1" "DATE=1993"; processor; processor; reader;
License
MIT