Packet
The unit of transmission of OSC is an OSC Packet. The contents of an OSC packet must be either an OSC Message or an OSC Bundle
Test:
Constructor Summary
Public Constructor | ||
public |
constructor(value: Message | Bundle) Create a Packet instance holding a Message or Bundle |
Method Summary
Public Methods | ||
public |
pack(): Uint8Array Packs the Packet value. |
|
public |
Unpack binary data from DataView to read Messages or Bundles |
Public Constructors
Public Methods
public pack(): Uint8Array source
Packs the Packet value. This implementation is more like a wrapper due to OSC specifications, you could also skip the Packet and directly work with the Message or Bundle instance
Example:
const message = new Message('/test/path', 21.5, 'test')
const packet = new Packet(message)
const packetBinary = packet.pack() // then send it via udp etc.
// or skip the Packet for convenience
const messageBinary = message.pack()