# Broadcast to AWS

**URL:** <https://discourse.processing.org/t/broadcast-to-aws/43042>\
**Category:** Project Guidance\
**Created:** [October 23, 2023, 7:34pm UTC](https://discourse.processing.org/t/broadcast-to-aws/43042 "2023-10-23T19:34:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eduzal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/eduzal/32/759_2.png) [@eduzal](https://discourse.processing.org/u/eduzal)\
**Post date:** [October 23, 2023, 7:34pm UTC](https://discourse.processing.org/t/broadcast-to-aws/43042/1 "2023-10-23T19:34:36Z")

</div>

Hello

I need guidance for a new project that fell on my lap.  
I need to stream a float array from processing to AWS and then broadcast it to multiple mobile app clients.  
I’m clueless about this. Never been on this side of tech.

Thank youall in advance

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 23, 2023, 8:04pm UTC](https://discourse.processing.org/t/broadcast-to-aws/43042/2 "2023-10-23T20:04:59Z")

</div>

> [@Byte size shortened](https://discourse.processing.org/t/byte-size-shortened/13765/2):
>
> [Forum.Processing.org/two/discussion/12757/transmission-of-a-float-through-a-serial-link#Item\_5](http://Forum.Processing.org/two/discussion/12757/transmission-of-a-float-through-a-serial-link#Item_5) // https://Discourse.Processing.org/t/byte-size-shortened/13765/2 // GoToLoop (2019/Sep/02) import java.nio.ByteBuffer; import java.nio.FloatBuffer; static final int BYTES = Float.BYTES; final byte[] bytes = new byte[BYTES]; final FloatBuffer buf = ByteBuffer.wrap(bytes).asFloatBuffer(); float f; void setup() { println(buf.order(), java.nio.ByteOrder.nativeOrder(), ENTER); bytes[0] = (byte)…

[transmission-of-a-float-through-a-serial-link](https://forum.processing.org/two/discussion/12757/transmission-of-a-float-through-a-serial-link)

---

<div class="post-metadata">

**Author:** ![eduzal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/eduzal/32/759_2.png) [@eduzal](https://discourse.processing.org/u/eduzal)\
**Post date:** [October 24, 2023, 2:43am UTC](https://discourse.processing.org/t/broadcast-to-aws/43042/3 "2023-10-24T02:43:18Z")

</div>

care to walk me through it? didn’t understand any of it.  
i also didn’t see how can i start to broadcast it  
thanks

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 24, 2023, 8:19am UTC](https://discourse.processing.org/t/broadcast-to-aws/43042/4 "2023-10-24T08:19:28Z")

</div>

Oops, indeed those links were about receiving rather than transmitting data.

However, I don’t have any of the hardware and can’t help you much, sorry.

Anyways, a possible approach for transmitting a `float[]` array is having `byte[]` of _length_ = 4 times the `length` of `float[]`.

Then [**wrap()**](https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html#wrap-byte:A-int-int-) & **[asFloatBuffer()](https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html#asFloatBuffer--)** that `byte[]` array in order to get a [FloatBuffer](https://docs.oracle.com/javase/8/docs/api/java/nio/FloatBuffer.html) out of it.

From now on you can auto-convert the contents of `float[]` to `byte[]` via method [FloatBuffer](https://docs.oracle.com/javase/8/docs/api/java/nio/FloatBuffer.html)::[**put()**](https://docs.oracle.com/javase/8/docs/api/java/nio/FloatBuffer.html#put-float:A-), followed by method [**rewind()**](https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html#rewind--).

After that you can transmit the whole `byte[]` array, which now contains the `float` representation of the `float[]` array, using the Serial::**write()** method.

However, you’re still gonna need to convert the broadcast `byte[]` back to a `float[]` array inside your mobile app.

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [October 24, 2023, 4:14pm UTC](https://discourse.processing.org/t/broadcast-to-aws/43042/5 "2023-10-24T16:14:02Z")

</div>

You could make a model of serial communication with float arrays if you had an Arduino; do you have an Arduino?

---

<div class="post-metadata">

**Author:** ![eduzal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/eduzal/32/759_2.png) [@eduzal](https://discourse.processing.org/u/eduzal)\
**Post date:** [November 17, 2023, 12:16am UTC](https://discourse.processing.org/t/broadcast-to-aws/43042/6 "2023-11-17T00:16:04Z")

</div>

it was a lot easier than i tought, just using websocket library
