Hacker News new | ask | show | jobs
by samlewis 3164 days ago
This should be really easily if you use gstreamer pipelines. Something like this:

  # To send
  gst-launch filesrc location=file.wav ! wavparse ! audioconvert ! audio/x-raw-int,channels=1,depth=16,width=16,rate=44100 ! rtpL16pay ! udpsink host=localhost port=1234

  # To receive. You could also use something like VLC with "vlc rtp://localhost:1234" for this part. 
  gst-launch udpsrc port=1234 ! "application/x-rtp,media=(string)audio, clock-rate=(int)44100, width=16, height=16, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, channel-positions=(int)1, payload=(int)96" ! rtpL16depay ! audioconvert ! alsasink sync=false
gstreamer gives fairly good control over tuning things like jitter buffers and sampling rates. That said, I've never had to use it on Windows so YMMV.