{"dist":{"shasum":"45b885721ac8f7dd5cf22391d42106ae533ac678","tarball":"https://registry.npmjs.org/ogg-packet/-/ogg-packet-1.0.0.tgz","integrity":"sha512-zAnMuXkiAQI/7DLYcsFnN+ElM6BUk2h6FFmDRjh6IaOhMo4nMQhT3YFhrpU8LhP/BS8ZTAzchK0Bk+aH05fjrw==","signatures":[{"sig":"MEYCIQCl1h7yTAC8dXFucNblHdfcYZdBv4k5zD/8wA0DgJcciwIhALf3o2iaBxPFyM8LE4T1NAQGYFihTmfnLUxcvT23E/EH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./index.js","name":"ogg-packet","author":{"url":"http://tootallnate.net","name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"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`...\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","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"keywords":["ogg","libogg","packet","ogg_packet","struct"],"repository":{"url":"git://github.com/TooTallNate/node-ogg-packet.git","type":"git"},"_npmVersion":"1.1.62","description":"Manually construct `ogg_packet` struct instances","directories":{},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dependencies":{"ref-struct":"*"},"_id":"ogg-packet@1.0.0","version":"1.0.0"}