Skip to content

cast byte[] to serializable Object; communicate with audio device #1

@chenym250

Description

@chenym250

I want to be able to send binary audio data remotely to a pepper robot. While I was able to do so using Naoqi's sendRemoteBufferToOutput() method with qi framework and C++ SDK (2.5.5), I can't find a simple way to call that method in Java.

In C++, sendRemoteBufferToOutput() accepts an ALValue constructed from a binary buffer (ALValue.setBinary()); in Java it's even more ambiguous. According to jnaoqi's API, it accepts merely an Object. I tried passing a byte array or a list of bytes or a byteBuffer, none of which works, and I constantly get this error:
qimessaging.jni: Cannot serialize return value: Unable to convert JObject in AnyValue

(Additionally, when I was using qimessaging's API I got this error:
qimessaging.remoteobject: no promise found for req id:162 obj: 60 func: 2 type: Reply)

I looked into old documentations, and in version 1.14 there is a binding class for ALValue, called Variant, that I can't find in the new API. Qimessaging seemed to support customizable serializers, but I don't think it was included in the 2.5.5 release. So I ran out of ideas. Another way I can think of now is to wrap either ALValue or my entire C++ application in JNI, but I'd like to know the right way to call sendRemoteBufferToOutput() in Java before going that route.

In conclusion, my issue is: is it possible to pass a byte buffer to sendRemoteBufferToOutput() in Java?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions