Friday, 5 January 2018

Sending an ArrayBuffer from client to server using socket.io

Hi, I'm trying to send an arrayBuffer from my client to server for further use with the google api (pipe that stream). I got it to work with the binaryJs library, but unfortunately need to keep it to socket.io only. I've added the socket.io-stream library as well but couldn't make it work except the blob stream example for a text file.Basically I start the microphone on the client and generate a 16 Bit Buffer Array that I would need to send to my node via a stream to then pass it to the google speech api. Could anyone give me a hint?My buffer function on the client looks like that:function recorderProcess(e) { var left = e.inputBuffer.getChannelData(0); var left16 = convertFloat32ToInt16(left); console.log(left16); // socket.emit('bianryData', left16); }

Submitted January 05, 2018 at 10:11AM by vinnivinnivinni

No comments:

Post a Comment