OSCSocket

Description

Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts

The OSCSocket API lets you send and receive Open Sound Control packets. Despite the name, OSC is commonly used with VR applications too. It is used by some tracking and haptic systems that aren't exposed through OpenVR or OpenXR.

Overte doesn't have any built-in OSC functionality; OSC is only useful with scripts.

https://opensoundcontrol.stanford.edu/spec-1_0.html

Properties

Name Type Summary
receiveHost string

IP address for receiving OSC packets. 127.0.0.1 by default, and shouldn't be changed unless you know what you're doing and need to use something different.

receivePort number

IP port for receiving OSC packets. 9000 by default.

sendHost string

IP address to send OSC packets to. 127.0.0.1 by default, and shouldn't be changed unless you know what you're doing and need to use something different.

sendPort number

IP port to send OSC packets to. 9001 by default.

Methods

Name Return Value Summary
sendPacket None

Sends an encoded OSC packet. OSC bundles are not supported.

Signals

Name Summary
packetReceived

Triggered when an OSC packet is received. OSC bundles are not supported.

Type Definitions

TypedArgument
Type: Object

Primarily for differentiating between OSC integers and floats, since Number in JavaScript is always a 64-bit float.

Supported OSC types are:
  • i (32-bit integer)
  • f (32-bit float)
  • s (UTF-8 string)
  • b (ArrayBuffer)
  • F (boolean false)
  • T (boolean true)
  • N (null)

Properties

Name Type Summary
type string
value number | string | ArrayBuffer | boolean | null

Method Details

(static) sendPacket( address, …argumentsopt )

Sends an encoded OSC packet. OSC bundles are not supported.

Parameters

Name Type Attributes Description
address string

OSC address, starting with /

arguments OSCSocket.TypedArgument | number | string | ArrayBuffer | boolean | null <optional>
<repeatable>

Signal Details

packetReceived( address, arguments )
Returns: Signal

Triggered when an OSC packet is received. OSC bundles are not supported.

Parameters

Name Type Description
address string

OSC address starting with /

arguments Array.<OSCSocket.TypedArgument>