Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

musicmetadata

Package Overview
Dependencies
Maintainers
0
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

musicmetadata

Music metadata library for node, using pure Javascript.

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
782
decreased by-55.62%
Maintainers
0
Weekly downloads
 
Created
Source

Installation

Install via npm:

npm install musicmetadata

Supports

mp3 (1.1, 2.2, 2.3, 2.4), m4a(mp4), vorbis (ogg, flac)

API

var fs = require('fs'),
    musicmetadata = require('musicmetadata');

//create a new parser from a node ReadStream
var parser = new musicmetadata(fs.createReadStream('sample.mp3'));

//listen for the metadata event
parser.on('metadata', function(result) {
  console.log(result);
});

This will output the standard music metadata:

{ artist : 'Spor',
  album : 'Nightlife, Vol 5.',
  albumartist : ['Andy C', 'Spor'],
  title : 'Stronger',
  year : '2010',
  track : { no : 1, of : 44 },
  disk : { no : 1, of : 2 },
  picture : { format : 'jpg', data : <Buffer> }
}

If you just want the artist - listen for the artist event:

parser.on('artist', function(result) {
  console.log(result);
});

You can also listen for the 'done' event, this will be raised when parsing has finished or an error has occurred. This could be used to disconnect from the stream as soon as parsing has finished, saving bandwidth.

parser.on('done', function(err) {
if (err) throw err;	
  stream.destroy();
});

Changelog

v0.1.2

  • Fixed id3v1.1 implementation
  • Implemented multiple artwork support (id4)
  • Added flac support

Commits

v0.1.1

  • Better utf-16 handling
  • Now reads iso-8859-1 encoded id3 frames correctly
  • Artwork is now part of the 'metadata' event

Commits

FAQs

Package last updated on 15 May 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc