ogg-parser

0.3.1 • Public • Published

Ogg Audio File Metadata parser

A simple streaming parser for retrieving metadata from an .OGG file.

Install

npm install ogg-parser

Use

The parser is simply a stream in objectMode, so you can pipe and binary data into it and it will spit out tag objects.

var OGG = require('ogg-parser')
  , stream = require('fs').createReadStream('./my-file.ogg')

var parser = stream.pipe(new OGG());

parser.on('data', function(tag){
    console.log(tag.type)  // => 'bitRateNominal'
    console.log(tag.value) // => 128000
})

Tags

In addition to the normal vorbis comments metadata the Ogg parser exposes additional stream info

  • version
  • sampleRate
  • channels
  • bitRateMax
  • bitRateMin
  • bitRateNominal
  • duration

consult the vorbis parser (used internally for comments) documentation for more information

Package Sidebar

Install

npm i ogg-parser

Weekly Downloads

38

Version

0.3.1

License

MIT

Last publish

Collaborators

  • monastic.panic