I am trying to transfer audio from a browser (through a microphone) to a server for playback on speakers connected to a computer.
My server code calls getUserMedia (), pulls the left channel (b / c mono input) and sends it through websockets to my server, every 1024 bytes each time.
I have a built-in device (I think RPi) that works with node and with a connected speaker. I would like to somehow take these bytes and transfer them to the node server running sails.js, which then plays the audio from the connected speaker
Client
function recorderProcess(e) {
var single = e.inputBuffer.getChannelData(0);
io.socket.post('/emit_audio', convertFloat32ToInt16(single), function(){
console.log('bytes sent');
});
}
Server
emit_audio: function(req, res) {
sails.log('got bytes');
},
, . , , req.files() sails-skipper, . ajaxy ?