{"_id":"@audc/ogg-packet","name":"@audc/ogg-packet","dist-tags":{"latest":"2.0.0"},"versions":{"2.0.0":{"name":"@audc/ogg-packet","description":"Manually construct `ogg_packet` struct instances","keywords":["ogg","libogg","packet","ogg_packet","struct"],"version":"2.0.0","license":"MIT","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://tootallnate.net"},"repository":{"type":"git","url":"git+https://github.com/orgads/node-ogg-packet.git"},"main":"./index.js","dependencies":{"ref-struct":"npm:@audc/ref-struct@^2.0.0"},"_id":"@audc/ogg-packet@2.0.0","gitHead":"526df408f4702984e726a29c8eff25fb5b7e0c59","bugs":{"url":"https://github.com/orgads/node-ogg-packet/issues"},"homepage":"https://github.com/orgads/node-ogg-packet#readme","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-VIJzIStlvm2Si0ESE6qJhnMnH/cfH33DvmSv58HpXTW9iZyu05cFjgdBQlr/HeXs7TjyxhJSfhdzPjDGTuQVIQ==","shasum":"b2149735f9daad6ca38673b362965be07eb25c2c","tarball":"https://registry.npmjs.org/@audc/ogg-packet/-/ogg-packet-2.0.0.tgz","fileCount":4,"unpackedSize":4064,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCfwLRWt3EpyBorre+uZIoJDTRsGHsy5/WInEW0D06ZmgIhAOpc6oJASYWlGZOZVYqdx51EhurVJFCozyT+2BEJr60p"}]},"_npmUser":{"name":"orgads","email":"orgads@gmail.com","actor":{"name":"orgads","email":"orgads@gmail.com","type":"user"}},"directories":{},"maintainers":[{"name":"orgads","email":"orgads@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ogg-packet_2.0.0_1751872578451_0.5137222627745341"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-07T07:16:18.339Z","2.0.0":"2025-07-07T07:16:18.647Z","modified":"2025-07-07T07:16:18.923Z"},"maintainers":[{"name":"orgads","email":"orgads@gmail.com"}],"description":"Manually construct `ogg_packet` struct instances","homepage":"https://github.com/orgads/node-ogg-packet#readme","keywords":["ogg","libogg","packet","ogg_packet","struct"],"repository":{"type":"git","url":"git+https://github.com/orgads/node-ogg-packet.git"},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://tootallnate.net"},"bugs":{"url":"https://github.com/orgads/node-ogg-packet/issues"},"license":"MIT","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","readmeFilename":"README.md","_rev":"1-d4ab44a3b2ff6a5038165585405c05ac"}