Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Small parser for Vorbis Bit streams
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitattributes
.gitignore
License
README.md
binaryHelpers.js
package.json
test.js
vorbis.ogg
vorbisParser.js

README.md

Vorbis Bit Stream Metadata parser

A simple streaming parser for retrieving metadata from a vorbis stream. Nor generally useful by itself as vorbis streams tend to be nested inside other audio formats, such as OGG or FLAC files. More then likely you want one of those higher level parsers (OGG parser and FLAC parser)

Install

npm install vorbis-parser

Options

The Vorbis parser takes one options framingBit -> bool which tells the parser whether the headers contain a framing bit at the end of them (flac comments do not).

There is also a static method VorbisParser.parsePicture(data -> Buffer) which will return an object of parsed image data

{
    mime: 'image/png',
    desc: 'a description field'
    data: Buffer<01, 03, 01, etc>
    info: {
        w: 300,
        h: 500
        depth:  int,
        colors: int
    }
}

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 Vorbis = require('vorbis-parser')
  , stream = getVorbisStreamData()

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

parser.on('data', function(tag){
    console.log(tag.type)  // => 'bitRateNominal'
    console.log(tag.value) // => 128000
})
Something went wrong with that request. Please try again.