java - "streaming" localy : UDP, TCP, something else? -


i'm trying work on code of mixing console , need advices before coding (hoping question won't "off topic").

in project, on each "stripe" of mixing console, i'll can enter source : audio file player, microphone... succed first part. in last stripe called "master", have collect sound signals mix them together. first test, i'll try add them (and see happens).

but question : what's best way send sound stripe master ? lag have short : if sing in microphone while music playing, voice collected in microphone have arrive in master "immediatly" mixed, , not 15 seconds later...

so, thought using simple udp transfert : it's fast comparated tcp. i'll "stream" each stripe on local address 127.0.0.1 (and not on whole internet), consider "datagram losses" insignificant ? or shall try implement rtp (really heavier...) on udp ? or else didn't thought ?

i don't post code because aim have advices before writing line , lines , noticing i'm in wrong way...

thank answers. regards.

if send tcp packet new york tokyo take less 300 ms. if send tcp packet across city should less 25 ms via internet. if send packet via wifi, should take less few milli-seconds , on local lan should under 0.1 ms.

note: if send packet moon , take 2.5 seconds.

however, if use udp might faster, or might slower, or might not arrive @ all. udp lossy protocol there no guarantee packet received, , no built in way detect such packet lost.

in short, use tcp. micro-second difference won't important lost packets.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -