Sometimes OS X will flatly refuse to change the audio output to an AirPlay outlet, such as an Apple TV or Airport Express (with no visible error message).
When this happens I’ve found that killing the CoreAudio daemon (
coreaudiod) helps (OS X will automatically restart it).
Simply run this command in Terminal:
sudo pkill coreaudiod
AirPlay should work again a few moments later.