index.js 849 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * Module dependencies.
  3. */
  4. var Struct = require('ref-struct');
  5. /**
  6. * `ogg_packet` is used to encapsulate the data and metadata belonging
  7. * to a single raw Ogg/Vorbis packet.
  8. *
  9. * typedef struct {
  10. * unsigned char *packet;
  11. * long bytes;
  12. * long b_o_s;
  13. * long e_o_s;
  14. *
  15. * ogg_int64_t granulepos;
  16. *
  17. * ogg_int64_t packetno; sequence number for decode; the framing
  18. * knows where there's a hole in the data,
  19. * but we need coupling so that the codec
  20. * (which is in a separate abstraction
  21. * layer) also knows about the gap
  22. * } ogg_packet;
  23. */
  24. module.exports = Struct({
  25. packet: 'uchar *',
  26. bytes: 'long',
  27. b_o_s: 'long',
  28. e_o_s: 'long',
  29. granulepos: 'int64',
  30. packetno: 'int64'
  31. });