{"_id":"ogg-packet","_rev":"4208687","name":"ogg-packet","description":"Manually construct `ogg_packet` struct instances","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"time":{"modified":"2026-03-04T17:04:35.000Z","created":"2012-12-02T20:50:13.682Z","1.0.1":"2019-03-13T22:08:35.713Z","1.0.0":"2012-12-02T20:50:13.682Z"},"users":{},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://tootallnate.net"},"repository":{"type":"git","url":"git://github.com/TooTallNate/node-ogg-packet.git"},"versions":{"1.0.1":{"name":"ogg-packet","description":"Manually construct `ogg_packet` struct instances","keywords":["ogg","libogg","packet","ogg_packet","struct"],"version":"1.0.1","license":"MIT","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://tootallnate.net"},"repository":{"type":"git","url":"git://github.com/TooTallNate/node-ogg-packet.git"},"main":"./index.js","dependencies":{"ref-struct":"*"},"gitHead":"27d254a0e9afe24b0283c59bc1fc7ee7918335b5","bugs":{"url":"https://github.com/TooTallNate/node-ogg-packet/issues"},"homepage":"https://github.com/TooTallNate/node-ogg-packet#readme","_id":"ogg-packet@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"dist":{"shasum":"6b7d6c7a743c5f1ae9277c3b1271cac256af4785","size":2083,"noattachment":false,"key":"/ogg-packet/-/ogg-packet-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ogg-packet/download/ogg-packet-1.0.1.tgz"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ogg-packet_1.0.1_1552514915552_0.46150205473317074"},"_hasShrinkwrap":false,"publish_time":1552514915713,"_cnpm_publish_time":1552514915713,"_cnpmcore_publish_time":"2021-12-15T11:11:03.616Z"},"1.0.0":{"name":"ogg-packet","description":"Manually construct `ogg_packet` struct instances","keywords":["ogg","libogg","packet","ogg_packet","struct"],"version":"1.0.0","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://tootallnate.net"},"repository":{"type":"git","url":"git://github.com/TooTallNate/node-ogg-packet.git"},"main":"./index.js","dependencies":{"ref-struct":"*"},"_id":"ogg-packet@1.0.0","dist":{"shasum":"45b885721ac8f7dd5cf22391d42106ae533ac678","size":1442,"noattachment":false,"key":"/ogg-packet/-/ogg-packet-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ogg-packet/download/ogg-packet-1.0.0.tgz"},"_npmVersion":"1.1.62","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1354481413682,"_hasShrinkwrap":false,"_cnpm_publish_time":1354481413682,"_cnpmcore_publish_time":"2021-12-15T11:11:03.810Z"}},"readme":"node-ogg-packet\n===============\n### Manually construct `ogg_packet` struct instances\n\nThis module lets you construct your own `ogg_packet` struct instances using\nJavaScript and Buffers. You'll most likely not need to use this module for any\npractical purposes, but it is useful for testing purposes.\n\nThe more common way to get _proper_ `ogg_packet` structs is via a decoded OGG file\nand node-ogg's `ogg.Decoder` class, or one of the codec's encoder classes like\nnode-vorbis' `vorbis.Encoder` class.\n\n\nInstallation\n------------\n\n``` bash\n$ npm install ogg-packet\n```\n\n\nExample\n-------\n\n``` javascript\nvar ogg_packet = require('ogg-packet');\n\n// create an `ogg_packet` struct instance\nvar packet = new ogg_packet();\n\n// the contents of the \"packet\"\nvar buf = new Buffer('hello world');\npacket.packet = buf;\npacket.bytes = buf.length;\n\n// this will be the first packet in the ogg stream\npacket.b_o_s = 1;\n\n// there will be more `ogg_packet`s after this one in the ogg stream\npacket.e_o_s = 0;\n\n// the \"granulepos\" is a time-constant value used by the codec decoder\npacket.granulepos = 12345;\n\n// the \"packetno\" should increment by one for each packet in the ogg stream\npacket.packetno = 0;\n\n// now send the packet off to an `ogg.Encoder` or\n// a codec-specific decoder like `vorbis.Decoder`...\nstream.packetin(packet.buffer, function (err) { /* ... */ });\n```\n\n\nAPI\n---\n\n### ogg_packet class\n\nA `ref-struct` class that mirrors the `ogg_packet` fields in the `ogg.h` file.\n\n``` c\ntypedef struct {\n  unsigned char *packet;\n  long  bytes;\n  long  b_o_s;\n  long  e_o_s;\n  ogg_int64_t  granulepos;\n  ogg_int64_t  packetno;\n} ogg_packet;\n ```\n","_attachments":{},"homepage":"https://github.com/TooTallNate/node-ogg-packet#readme","bugs":{"url":"https://github.com/TooTallNate/node-ogg-packet/issues"},"license":"MIT"}