For someone interested in a small automation of this workaround, I have written a small apple script that toggles between internal speakers and Airplay - taking into account that from time-to-time it is not possible to switch because of the Apple Bug. In this case, the script asks for the Admin password and restarts core audio before continuing.
It is mainly based on the small C program to toggle airplay found here :
http://whoshacks.blogspot.de/2009/01/change-audio-devices-via-shell-script.html
And a proposal applescript that implements it:
http://www.macuser.de/forum/f30/applescript-um-airplay-672797/
Just copy the C programme into the user folder, paste the code below into the AppleScript Editor and save it there as a program.
Code:
property audiodeviceOutputExecutable : "~/audiodevice output "
property internalAudioDevices : "Internal Speakers"
property airplayDevice : "Airplay"
property kill_audio : "pkill coreaudio"
set currentDevice to do shell script audiodeviceOutputExecutable
if currentDevice is airplayDevice then
do shell script audiodeviceOutputExecutable & quoted form of internalAudioDevices
set currentDevice to do shell script audiodeviceOutputExecutable
if currentDevice is airplayDevice then
do shell script kill_audio with administrator privileges
do shell script audiodeviceOutputExecutable & quoted form of internalAudioDevices
end if
else
do shell script audiodeviceOutputExecutable & quoted form of airplayDevice
set currentDevice to do shell script audiodeviceOutputExecutable
if currentDevice is internalAudioDevices then
do shell script kill_audio with administrator privileges
do shell script audiodeviceOutputExecutable & quoted form of airplayDevice
end if
end if
For me this is working fine and it is much quicker to change to airplay via the dock.