First is your Mac, followed by each of the AirPlay devices on your local network. To send audio to just one AirPlay device, click it. iTunes takes a few seconds to find the device and send audio to it, so you'll notice a bit of a delay once you hit play. If you want to send the same audio to more than one device, click Multiple at the top of the window and select the devices you want. You can now adjust the volume for each device individually.
If you want to send all the audio from your Mac to an AirPlay device and you're running Mountain Lion, you have two options. The first is to take a trip to System Preferences and click on the Output tab of the Sound pane. Now select the AirPlay device you want from the list. A quicker route is to Option-click on the volume control in the menu bar and select the AirPlay speaker from the drop-down menu.
Mountain Lion introduced another new AirPlay feature to OS X for newer Macs: mirroring. In the same way you can mirror the output of an iPhone or iPad on an Apple TV, your Mac's audio and video can be sent to your TV using an Apple TV. When you connect a compatible Mac running 10.8 to a network that also has an Apple TV on it, an AirPlay menu item appears in OS X's menu bar. Click on it and then select the Apple TV on which you want to mirror your Mac.
If you select Match Desktop Size To Apple TV, it will scale the output of your Mac to fit your TV screen. If you want a sharper image, set the resolution of your Mac to as close to that of your TV as possible. You do this in the Displays pane of System Preferences, by selecting an option that only appears when you mirror to an Apple TV.
Presentations and more
Mirroring to Apple TV from your Mac has numerous possible uses. One of the most popular is for displaying presentations on a large TV screen. Many conference rooms have large-screen HDTVs, so by packing an Apple TV alongside your Keynote-equipped MacBook Pro, you eliminate that perennial worry of having the correct adaptor for whichever projector the client happens to have - though this does add the problem of joining their Wi-Fi network!
To mirror a Mac to an Apple TV over AirPlay, you'll need a Mac made in 2011 or later running Mountain Lion. If your Mac was made earlier than that, or you aren't using Mountain Lion, Air Parrot (airparrot.com) may allow you to do the same thing.
Set up a speaker
Different devices use different methods, but let's look at the basics...
1. Read the manual
Check the manual for your AirPlay device to find out which set-up methods it supports before you begin. From that you can decide whether to use a Mac or iOS device. Whichever method you use, the first step is usually to turn the device on.
2. Network shenanigans
You then need to add it to your network. If your speaker can read your Wi-Fi password from your iOS device, dock it, press the buttons indicated in the manual if necessary, and, once your iOS device has alerted you, just tap Accept.
3. Enter an IP
Some AirPlay speakers will need you to connect to their own Wi-Fi network to configure them. Click the AirPort menu on your Mac - or look in iOS's Settings app - connect to the network temporarily, then enter an IP address (see the manual) into Safari. Once configured, connect to your normal network again.
4. 'Appy days
Another common method is to use an iOS app. Some speakers prompt you to download it when you plug your device in, but you might have to manually search the App Store.