It looks to me like that's still one complete message - like you're not sending small chunks, but are just sending one big chunk of wave file.
The Websocket library should handle binary data just fine, but will only notify you when it has received a complete frame of data (I think they all work like this). If that's a relatively big frame it could take a while - it may even run out of memory first.
I guess it's possible that the WebSocket library has some bug when handling frames >127 bytes? It might be worth testing it out with smaller size frames first
You can handle the binary data pretty easily once it's in - the trick is to try not to do any copies if you want to get a reasonable amount of speed out of it. Use E.toUint8Array() on the string, and then you can do things like E.FFT on it to pull out frequencies if you want to.
Were you trying to stream live wave data to it? The connection is usually only 115200 baud and it looks like you're sending 16 bit data, so you'll struggle I think. To have much chance of handling it live you'd be looking at 4ksps, 8 bit, mono I reckon.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
It looks to me like that's still one complete message - like you're not sending small chunks, but are just sending one big chunk of wave file.
The Websocket library should handle binary data just fine, but will only notify you when it has received a complete frame of data (I think they all work like this). If that's a relatively big frame it could take a while - it may even run out of memory first.
I guess it's possible that the WebSocket library has some bug when handling frames >127 bytes? It might be worth testing it out with smaller size frames first
You can handle the binary data pretty easily once it's in - the trick is to try not to do any copies if you want to get a reasonable amount of speed out of it. Use
E.toUint8Array()
on the string, and then you can do things likeE.FFT
on it to pull out frequencies if you want to.Were you trying to stream live wave data to it? The connection is usually only 115200 baud and it looks like you're sending 16 bit data, so you'll struggle I think. To have much chance of handling it live you'd be looking at 4ksps, 8 bit, mono I reckon.