Streaming audio from a Mac to another computer using VLC

VLC is a very popular program for playing pretty much any type of media under the sun. However, it has a lot of advanced functionality that many people may not know about. One of these is that VLC can send audio as a stream.

My particular case is that I have a wireless headphone set plugged in to my desktop computer in my living room. However, sometimes I would like to play some audio from my Mac laptop (which could be anywhere in my apartment).

I was already familiar with Icecast, a free audio streaming server, so I gave that a try first, but it was not a great experience with a delay of a few to several seconds. Instead, I found that VLC could get me down to just under 1 second of latency, which still isn’t great but is workable; at least the server setup wouldn’t be required simplifying things a bit.

Installing Soundflower

I needed some way to redirect the Mac’s audio output to its input so that VLC could capture it. The only free program I’ve found to do this on a Mac is Soundflower. It seems to be “barely” maintained these days, but its functionality still works on macOS Catalina.

Soundflower installs a virtual audio device that you can find in the Output and Input section of the Sound System Preferences:

By selecting Soundflower in the Output section, all the sound that would normally come out of the speakers/headphones/etc. would go into Soundflower instead.

Adding a multi-output device

This step is only necessary if you want to hear the audio output from your speakers/headphones/etc. in addition to streaming it to another computer. If not, you can skip this section.

In Spotlight, open “Audio Midi Setup”.

At the bottom left, create a new Multi-Output Device.

And for the new multi-output device, select the devices you want audio to play through to.

And finally back in Sound System Preferences, set the output device to Multi-Output Device.

Note that while the Multi-Output Device is selected, the speaker volume controls won’t work as usual. The simplest workaround I’ve found is to switch back to the speaker device (recommended to turn on “Show volume in menu bar” enabled so you can switch from the menu bar), change the volume, then switch back to the Multi-Output Device.

Receiving the stream

It’s probably easier to set up the receiving end first. This can be done on any computer that can run VLC, not necessarily a Mac as depicted below.

If you want, in VLC’s preferences, find the network latency settings and change them to “Lowest Latency”.

On your destination computer’s VLC, go to File -> Open Network. In the URL, type: udp://@:8123. This basically tells VLC to listen on port 8123 for the media stream. If 8123 happens to be used by another program on your computer, you can change it to any other unused port number (generally between 1000-65000 will work).

When you click “Open”, VLC will start listening on that port. Nothing will happen because we need to set up sending the stream.

Sending the stream

First you’re going to need to find the IP address of the other computer. I’m going to assume you’re only going to do this within a local area network (LAN) and that there are no additional firewall or other considerations.

In VLC, go to File -> Open Capture Device.

Select Audio, and the Soundflower device. Also select Stream output and click Settings on the right. Set up the options as below, replacing “10.0.0.102” with the IP address of your destination computer, and “8123” with the port you specified on the destination computer, if different.

When you click OK, then Open, VLC will return back to the Playlist pane. There isn’t any visual indication that things are working, but they should be. You should be hearing audio from the destination.

Unfortunately if things aren’t working at this point, it’s not the easiest thing to pinpoint what the issue is. Check that the IP addresses and ports are correct, and that the computer or network’s firewalls aren’t blocking sending/receiving of the stream.

Conclusion

VLC is a powerful media tool that besides playing back media, can stream media from one computer to another.

Using mostly default settings, the latency of the VLC stream is about 1 second. This is fine when listening to music or podcasts, but doesn’t really work when watching a movie, or playing a game, which require video and audio sync. If anyone knows any settings or tools to lower the latency of a 1:1 stream for a use case like this, please do let me know in the comments!

Leave a Reply

Your email address will not be published. Required fields are marked *