Mac Optical Output (Audio)
The Mac optical output for digital audio is a nice goodie that sometimes goes unused. On the iMac and MacBook Pro, it is built-in to the mini-jack headphone/lineout connector while an older Mac Pro may have a separate connector. The optical output can be a viable option for playback if you have an audio device that uses optical input. Be sure to check the features on your Mac model and audio gear for specifics*.
The Hook Up
If both devices (Mac and receiving device) use optical mini jack you will need an optical mini jack to optical mini jack cable. However, tapping into the optical out often requires going from an optical mini jack connector to a TOSLINK™ connector. There are a couple of ways to accomplish this. One is to use an optical cable with a built-in mini-jack connector on one end and TOSLINK on the other. Another way is to use a TOSLINK to mini-jack adapter along with a standard TOSLINK cable. Check the device you are planning to use (d/a converter box, amplifier, powered monitors) for a TOSLINK optical input or optical mini jack input.
When you plug the optical mini-jack into the Mac, it should detect that an optical connection is present. To verify, go to the Apple menu > System Preferences > Sound > Output. You should see optical listed as the output or as one of the selectable options. The device you are using may require optical to be manually selected as the input source. In some cases the device may also require the sample rate and/or the clock source to be selected as well. If that’s the case, set the sample rate to be the same as your audio file/source that you will playing from the Mac. Set the device's clock source to optical (digital input) if necessary. Checking the device's manual is the best safeguard so don't hesitate to do so.
Arguments can lean one way or the other so far as the technological advantages of Firewire vs optical vs USB (and now Thunderbolt). In any case, generally keep the distance of the digital run from the Mac to the audio device as short as possible and use quality components (cable, adapter). Using the Mac’s output connector mutes the speaker playback on many, if not all, models. Since a mini-jack may be more fragile compared to some types of connections, make sure to exercise care when plugging in or out.
In some cases you may find the Mac's digital-to-analog convertors to be superior to the audio device's. Doing some comparison testing is never a bad idea. But from the standpoint of transferred the purest audio signal without interference, a digital connection is often the best way to go.
Read here about hard drives.
*Some Mac models include audio input as well as output. MacBook Air does not have optical digital out. Check your specific model to be sure one of the optical outputs discussed in this article is available.