简体   繁体   English

如何在 Java 中接收大的 OSC blob

[英]How to receive big OSC blob in Java

I am trying to receive quite big OSC blob (array of more than 10000 bytes) from PureData with Java.我正在尝试使用 Java 从 PureData 接收相当大的 OSC blob(超过 10000 字节的数组)。

I tried oscP5 library and I got ArrayIndexOutOfBoundsException above around 1500 bytes.我尝试了oscP5 库,结果ArrayIndexOutOfBoundsException超过了大约 1500 字节。

I have the same with JavaOSC library with the same limitation (with code example from https://wush.net/trac/lsu-idt/wiki/JavaOSC ).我对JavaOSC 库也有同样的限制(使用来自https://wush.net/trac/lsu-idt/wiki/JavaOSC 的代码示例)。

NetUtil [3] lib give me de.sciss.net.OSCException: Error while receiving OSC packet: java.nio.BufferUnderflowException NetUtil [3] lib 给我de.sciss.net.OSCException: Error while receiving OSC packet: java.nio.BufferUnderflowException

However I can easily receive those blob and even bigger one with PureData.但是,我可以使用 PureData 轻松接收这些 blob 甚至更大的 blob。 So I guess something is wrong with my Java configuration.所以我猜我的 Java 配置有问题。

I tried to increase the VM memory with -Xms512m and even -Xms2048m, but this doesn't help.我尝试使用 -Xms512m 甚至 -Xms2048m 来增加 VM 内存,但这无济于事。

The oscP5 library has a default datagram size of 1536, which is why you experienced that bound. oscP5 库的默认数据报大小为 1536,这就是您遇到该限制的原因。 You can change the datagram size with OSCProperties::setDatagramSize(), which is used in the constructor of the OscP5 object:您可以使用 OSCProperties::setDatagramSize() 更改数据报大小,它在 OscP5 对象的构造函数中使用:

OscP5(Object theParent, OscProperties theProperties) OscP5(Object theParent, OscProperties theProperties)

See this link for an old example from the Processing forum:请参阅此链接以获取处理论坛中的旧示例:

https://forum.processing.org/one/topic/query-re-sending-large-number-of-values-to-processing-via-osc-from-supercollider.html https://forum.processing.org/one/topic/query-re-sending-large-number-of-values-to-processing-via-osc-from-supercollider.html

Clay Budin NYC粘土布丁纽约

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM