Results 1 to 5 of 5
hi.
I'm trying to create simple p2p voice-chat script.
my first attempt was to establish one way communication using sox and netcat:
on receiving computer:
Code:
nc -l 0.0.0.0 1234 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-30-2013 #1Just Joined!
- Join Date
- Jan 2013
- Posts
- 3
audio over socket
hi.
I'm trying to create simple p2p voice-chat script.
my first attempt was to establish one way communication using sox and netcat:
on receiving computer:
and on sending:Code:nc -l 0.0.0.0 1234 | play -r 8k -t flac -
audio from default input in one computer is played on second box, but there's over 4 second lag...Code:rec -r 8k -t flac - | nc 192.168.1.11 1234
can someone recommend any solution?
maybe some other recording and playback software or different codec?
TIA
- 01-30-2013 #2Linux Newbie
- Join Date
- Jun 2012
- Posts
- 100
Why not use the UDP switch in netcat?
Originally Posted by man nc
- 02-03-2013 #3Linux Newbie
- Join Date
- Dec 2011
- Posts
- 139
I have a guess that the flac compression is slowing things down, both on send and recieve. Try raw audio.
I think I'll try it myself.
- 02-03-2013 #4Just Joined!
- Join Date
- Jan 2013
- Posts
- 3
actually i've made some progress here. it looks like it's more buffering than codec issue (but raw audio is indeed slightly faster)
usingandCode:rec --buffer 18 -r 64k -c 1 -t ul - | nc 192.168.1.11 12345
, lag is small enough.Code:nc -l 0.0.0.0 12345 | play --buffer 18 -r 64k -c 1 -t ul -
but there's still that buffer problem. i need to use very high sample rate in order to "overflow" buffer quickly, but that seams like a waste of bandwidth.
anyone know recording/playback program with "unbuffered" mode?
Last edited by patryk; 02-03-2013 at 07:45 PM.
- 02-04-2013 #5Linux Newbie
- Join Date
- Mar 2010
- Posts
- 152
Programming and other random guff: cat /dev/thoughts > blogspot.com (previously prognix.blogspot.com)


Reply With Quote
