Thank for responding.
Assume that client is android.
I can reading voice data from device, and sent to nodejs server.
nodejs server use datagram library to receive voice data which is sent from 
device.
Now, i can't find solution to send received voice data to all connected 
clients.

Here is some code on server side
///////////////////////////////////////////////////////////////////////////////////////////
var http = require('http'),
    dgram = require('dgram'),
    socketio = require('socket.io');

var app = http.createServer(handleRequest),
    io = socketio.listen(app),
    socket = dgram.createSocket('udp4');

socket.on('message', function(content, rinfo) {
    console.log('got message', content, 'from', rinfo.address, 'port 
',rinfo.port);
    
io.sockets.emit('udp_message', 'test',rinfo.port);
 socket.send(content, 0, content.length, 50006, rinfo.address, 
function(err, bytes) {
//socket.close();
});
 });

function handleRequest(req, res) {

    res.writeHead(200, {'content-type': 'text/html'});
    res.end("<!doctype html> \
        <html><head> \
        <script src='/socket.io/socket.io.js'></script> \
        <script> \
            var socket = io.connect('localhost', {port: 8000}); \
            socket.on('udp message', function(message) { 
console.log(message) }); \
        </script></head></html>");

}

socket.bind(50005);
app.listen(8000);
///////////////////////////////////////////////////////////////////////////////////////////

I am waiting for your respons.

2012年9月20日木曜日 22時54分17秒 UTC+7 Tim Caswell:
>
> I would start by reading up on audio encoding formats.  This alone is 
> a pretty complex topic.  Also, what is you client, what capabilities 
> does it have?  If the client is a browser that's very different than 
> say a native mobile client on iOS.  As far as the node part, building 
> a simple data proxy is easy, but usually you want to do more. 
>
> On Wed, Sep 19, 2012 at 11:19 PM, Chi Linh Le 
> <[email protected]<javascript:>> 
> wrote: 
> > Hi All 
> > 
> > I am building a app with push-to-talk (conference call) function. 
> > Model of app as below. 
> > 
> > client A--(voice data)--->server (nodejs)--(voice data)--->client B 
> > 
> > I have some question. 
> > 
> > 1. How do get voice data from client? 
> > 2. How do send voice data to all connected client? 
> > 
> > Anyhelp is appreciated! 
> > 
> > -- 
> > Job Board: http://jobs.nodejs.org/ 
> > Posting guidelines: 
> > 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 post to this group, send email to [email protected]<javascript:> 
> > To unsubscribe from this group, send email to 
> > [email protected] <javascript:> 
> > For more options, visit this group at 
> > http://groups.google.com/group/nodejs?hl=en?hl=en 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to