Mac GeekeryGet your geek on. |
|
blog advertising is good for you
recent popular content
User login
|
Getting back to our roots for a moment, here’s a nice little bit of geekery. You can use the built-in audio units AUNetSend and AUNetReceive to generate audio on one computer and have it play back on another computer. Moreover, these computers do not need to be on the same local network, and the created audio can be though any program from GarageBand to VLC to iTunes. The short of it is that you need to capture the audio from the computer playing it and pipe that in to the AUNetSend audio unit. On the other end, you’ll need to tell AUNetReceive to use the audio from that other computer. That’s how this works. Now, getting these two audio units going is a whole other problem. Audio units are plugins for Core Audio, and as such they’ll need a Core Audio program to play host to them so they can work their magic. AUNetReceive, in particular, is a Generator Unit and needs a program that has explicit support for it. You can use GarageBand, Logic, or even Audio Hijack to use these audio units, but all of those cost some amount of money. If you have them, you can try to use ‘em. If not, and if you’ve been a Mac Geekery reader for any amount of time, then you should have the Developer Tools installed and have a program called AU Lab at /Developer/Applications/Audio. This is going to be your new friend, and I’ll step through the process with this program since it’s the lowest-common-denominator in this arena. Setup the SenderYou’re going to need Soundflower installed for this so that AU Lab can capture the audio from a program as the Built-In Output option does not allow for capturing. Once installed, go to your Sound preference pane and in the Output tab pick the two-channel option (unless you have a specific need for more channels, which is to say you’re doing something more than this article goes into).
You should probably also get something playing in iTunes now so that you’ll know later on when things are working. Create a New Document in AU LabOnce you start AU Lab you’ll get a little new document assistant. Ensure you’ve chosen the same Soundflower device as you used earlier (probably the two-channel one). Now click on Inputs and then click on Add Input so that your screen looks like the one below. Hit OK.
Setup AUNetSend
When the document comes up, you should have the two channels pictured at the right. In the left channel, Audio Device, you need to click on that triangle under Effects and pick AUNetSend from the list. Once you do this, you should get a panel like the one below.
Go ahead and change the name so you know it’s working on the other side (more of a mental check than technical). Back on the channels list, make sure you hit the mute button on the Master Out channel so you don’t create a feedback loop. If you don’t, you’ll regret it later. Setup AUNetReceive
On the receiving computer, start AU Lab and accept the defaults for a new document. In the Edit menu, pick Add Audio Unit Generator… and select AUNetReceive from the list.
You should see the channel added to the list (as depicted in the graphic to the right) and you should get a configuration window asking which stream to use as a source. Ensure your volume is at a good level, the Master Out channel is muted on the source, and then pick the source you named last time and hit Select Host. The stream should play instantly.
Repeating This TrickNow for a fun trick. On both machines, save the documents somewhere on the machines and then drag the proxy icons to their respective Docks. Quit AU Lab on both machines and pause a little bit, then open up the documents again. It should automatically start the process for you. Now, add this in to the Startup Items for the receiving unit and any time the sending unit starts sending, it will start playing. You have now turned your Mac into an expensive AirPort Express. Congratulations. Actually, it’s even better, because this one will work with more than iTunes. It’ll work for any program you use on your Mac. It gets even better when paired with (or used within) Audio Hijack as you can then capture a select program’s audio and reroute that to another computer entirely (put iTunes on the home media server, but get error beeps locally). Variations on This Trick
About the CodecsWhen you’re using this over a slow link, you’ll need to be aware of the properties of the various codecs in the AUNetSend menu. Here’s a breakdown of what the effective data rates are for these codecs. These were determined by playing the same song (in stereo) using Activity Monitor’s throughput rating while using each codec for at least five seconds to let it settle down.
1 Unlikely, I know, but that’s what it is. I didn’t hear a quality difference on the other end, either.
About Adam Knight
Author Biography Adam Knight is one of the founders of Mac Geekery and is a geek at heart. Programmer by day, hacker by night, his daily life revolves around the Macintosh platform, which he has been a user and programmer for since the early days of System 7 when his LCII replaced his Apple //c. In-between tech jobs, he’s managed to learn the basics of any web hacker: PHP, MySQL, Perl, Apache, Linux, *BSD, and the intricacies of ./configure —prefix=~/bombshelter/. Today, codepoet is concentrating on blogging again, writing some software for the Mac by himself (including Notae) and for his company (such as Switchblade) and has a few other toys coming out soon. Bug him over AIM or email [link fixed]. |
Thanks for the amazing tip. I was looking for a way to play music from my MBP to a yet to be bought Mac Mini. This is just the type of thing I need. In combination with the Trends Audio UD-10 (www.tnt-audio.com/sorgenti/trendsaudio_ud10_e.html) one of the best audio sources imaginable.
Thanks for this tip. Saved a whole lot of hassle trying to run Garage Band on a laptop, but stream the audio to my stereo (via my powerbook music server). Thanks!
any ideas to use a windows machine as the server part? I m trying to find a way to stream from my macbook to my windows box..
thks
Do you know any way of delaying the audio… so I can play it like 10 or 30 seconds later
thanks
Paul Galvez