How to use the osc/src/osc.js.readUtfString function in osc

To help you get started, we’ve selected a few osc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jean-emmanuel / open-stage-control / src / server / osc / osc.js View on Github external
var osc = require('osc/src/osc.js'),
    transports = require('osc/src/platforms/osc-node.js'),
    utf8 = require('utf8')

osc.UDPPort = transports.UDPPort
osc.TCPSocketPort = transports.TCPSocketPort

osc.writeUtfString = (str)=>{
    return osc.writeString(utf8.encode(str))
}

osc.readUtfString = (dv, offsetState)=>{
    return osc.readString(dv, offsetState)
}

osc.argumentTypes.s = osc.argumentTypes.S = {
    reader: 'readUtfString',
    writer: 'writeUtfString'
}

module.exports = osc