A quick guide to sending the audio from videos playing in the VLC media player through the Apple Airport Express, and keeping everything nicely synchronised (or "synchronized" for our American friends).
I recently bought an Apple Airport Express and iPod Hi-Fi. Connected together with an SPDIF cable, they allow me to listen to all my music from iTunes in gorgeous high quality anywhere in the house. But only iTunes can send its audio to the Airport Express. All other system audio comes through the normal speakers on the Mac. This is fine for most things, but I thought it would be nice to be able to route the audio from movies I was watching through the Hi-Fi, so I bought Rogue Amoeba's Airfoil software for $25 (about £13 or so). It allows you to "hijack" the audio from any application on your system and route it to the Airport Express.
The problem with this approach when watching videos is that the Airport Express has a fairly substantial delay between the audio being played on the computer and actually emerging from whatever equipment is connected to it, due to the encoding and decoding algorithms which are applied to the audio at each end. Watching a movie would be impossible because the video stream would be completely out of sync with the audio.
Fortunately, there is a way round this problem using the VLC media player. It took me a fair bit of trawling through strange geeky message boards to find this solution, so I thought I'd stick it up here in the hope that future Googlers will have an easier time.
- Launch VLC.
- Open the Preferences page from the VLC menu on the menu bar.
- Tick the "Advanced" check box in the bottom-left corner of the window.
- Under the "Audio" page (the page that comes up first when you open the Preferences), set the "Audio desyncronization compensation" value to -2700 (note the negative). *
- Drop down the "Input/Codecs" menu on the left-hand side of the Preferences window, then drop down the "Access Modules" menu. Select the "File" item. Set the "Caching Value in ms" to 3000.
- Quit VLC.
- Launch AirFoil. Select "VLC" from the "Source" drop-down list at the bottom of the window. Click the Transmit button (the one with the speaker icon on it).
- VLC should automatically launch. When it does, open the movie you wish to watch and enjoy your syncronised, high-quality audio.
- Some people seem to find -2650 a better value. Experiment with it. You can change the desync compensation on-the-fly while your movie is playing by using the f and g keys on the keyboard.