osc.js
osc.js copied to clipboard
How to send boolean?
Hello, I want to know how to send boolean value? 'i' = integer 'f' = float 's' = string but 'b' = blob and nothing for boolean
In the Open Sound Control spec, boolean values are defined by two different type tags, "T" (for true) and "F" (for false). You can specify these strings in the type field in your osc.js message argument object. If you're using osc.js' type inference feature with metadata: false (not recommended) you can get away with just supply a boolean directly.
For example:
{
address: "/foo",
args: [
{
type: "T",
value: true
}
]
}