ogg_packet struct instances
This module lets you construct your own
ogg_packet struct instances using
practical purposes, but it is useful for testing purposes.
The more common way to get proper
ogg_packet structs is via a decoded OGG file
ogg.Decoder class, or one of the codec's encoder classes like
$ npm install ogg-packet
var ogg_packet = ;// create an `ogg_packet` struct instancevar packet = ;// the contents of the "packet"var buf = 'hello world';packetpacket = buf;packetbytes = buflength;// this will be the first packet in the ogg streampacketb_o_s = 1;// there will be more `ogg_packet`s after this one in the ogg streampackete_o_s = 0;// the "granulepos" is a time-constant value used by the codec decoderpacketgranulepos = 12345;// the "packetno" should increment by one for each packet in the ogg streampacketpacketno = 0;// now send the packet off to an `ogg.Encoder` or// a codec-specific decoder like `vorbis.Decoder`...
ref-struct class that mirrors the
ogg_packet fields in the