I'm creating a relay server for my streaming app. Basically, it should work 
like this:
 
   1. Client A streams microphone audio to server through sockets
   2. Server a gets stream and maybe stores it somewhere temporarily?(not 
sure)
   3. Client B gets a stream from server and plays it.

Basically, I have 1st part done(sending mic audio to server):

    while(isStreaming)
    {
        minBufSize = recorder.read(buffer, 0, buffer.length);
        mSocket.emit("stream", Arrays.toString(buffer));
    }

And 3rd part done, simply playing audio:

    mediaplayer.reset();
mediaplayer.setDataSource("http://192.168.1.2:1337/stream";);
mediaplayer.prepare();
mediaplayer.start();

Now I'm not sure how to bridge incoming byte array and streaming. Here is 
my current server code:

    var ms = require('mediaserver');
    // from server to Client B
exports.letsStream = function(req, res, next) {
ms.pipe(req, res, "sample_song_music_file.mp3");
};

    // from Client A to server
exports.handleSocketConnection = function(socket)
{
console.log("connected");
socket.on('stream', function(data)
{
var bytes = JSON.parse(data);
console.log("GETTING STREAM: " + bytes);
});
}

Any suggestions? How can I directly stream that byte array?

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/250b6eeb-eace-445e-b688-c30903c533bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to