Ask HN: How to stream low latency audio from one machine to another over LAN?

Been trying to do this on and off for years now, at different moments for different reasons. Is there a simple way that makes it possible to stream (uncompressed) audio from one machine to another?

e.g. Windows 10 desktop PC audio output -> Macbook headphone output on the same LAN.

For what it's worth, I've known that it's possible for some people to accomplish this using VLC but I've been trying to use the same tutorials, in vain, for the better part of .. a decade now? .. without success via VLC. I also tried using IceCast but since it uses TCP it is kinda fucky. Thanks.

PS.

Currently using the SoundIt Chrome extension to stream a lower quality audio stream atop of the Chrome Remote Desktop api, but this is hardly ideal for a few reasons - a) the client webpage UI uses a ton of CPU and drains battery on my laptop, b) iffy quality at best and robotic crunches at worst, c) it seems unmaintained.

I'll buy another audio interface soon, but this is not really a problem that I don't want to again be unable to solve when it crops up in the future again..

3 points | by pizza 2372 days ago

2 comments

  • samlewis 2370 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.
  • cdvonstinkpot 2370 days ago
    Maybe something along the lines of Vortexbox [1] in a VM?

    [1]

    https://distrowatch.com/table.php?distribution=vortexbox