tags:

views:

363

answers:

3

hi every body could you please help me . I write java code for sending string msg between client and server using udp socket . but I want to to send real time voice so could you please give some notes to do it

+1  A: 

I can point you a little of the way, you probably would want to use the Real-time Transport Protocol (RTP), which is more or less the standard for sending audio or video real time over the net. However the implementation is not straight forward, and you should use a helper library like jlibrtp for the implementation. There is also a RTP packetizer in Java Media Framework (JMF), but you don't wanna go there....

takete.dk
A: 

Look into using Real Time Protocol RFC3550 (http://en.wikipedia.org/wiki/Real-time_Transport_Protocol) as the transport over UDP. RTCP as the control over TCP.

CodeLizard
+1  A: 

UDP has no quality of service guarantee, so when sending your packets of data you will need to add some sort of order number to your data to detremine how to put the data back together. For example you could send 3 datagram packets in order from the server, yet the client may get them in a different order (2,1,3). Or it may not get one of them at all, in which case you either want it resent (doubtful) or simply ignore it and move on at some timeout.

Gandalf