Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with sending/receiving blobs #153

Open
romamile opened this issue Sep 4, 2019 · 2 comments
Open

Issue with sending/receiving blobs #153

romamile opened this issue Sep 4, 2019 · 2 comments

Comments

@romamile
Copy link

romamile commented Sep 4, 2019

Hey,
I'm trying to send and receive blobs from nodejs with osc.js, through websockets, testing on a single computer. The issue: the UInt8Array I'm getting from the received blob is of the right size, but all values are zeros. Weirdly, if I send a float in the same message, that affect the value of the UInt8Array... Maybe I'm reading the array in a wrong way.

I'm sending with

    oscPort.send({
        address: "/blob",
        args: [
            {
            type: "b",
            value: new Uint8Array([5, 1, 7, 21])
            }   
        ]   
    }); 

and tried with value: Uint8Array([0x63, 0x61, 0x74, 0x21]) too, which triggered an error for a missing "new", which I add, and same zero array at reception.

I receive with

    socketPort.on("message", function (oscMsg) {
        console.log("An OSC Message was received!", oscMsg);
        console.log(oscMsg.args[0].value);
    }); 

which output

An OSC Message was received! { address: '/blob',
args: [ { type: 'b', value: [Uint8Array] } ] }
Uint8Array [ 0, 0, 0, 0 ]

I seem to have that issue only with blobs, as other type are sent/received well.
I'm running on Ubuntu 16.04LTS, node v10.16.3, osc 2.3.1

Thanks for your help!

@colinbdclark
Copy link
Owner

Hi @Zharkov, sorry to hear you're having trouble with sending blobs. You're right that the example code in osc.js' README wasn't quite right. I've filed an issue and fixed this.

As for the problem with your empty blobs, can you put together a simplified test case or example of some kind that I can run and try out myself?

Thanks!

@szekelyisz
Copy link

Sending works fine. If there's an error, it's on the receiving side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants