I would like to develop a Raspberry PI "music receiver" that would play Airplay audio by default, but if a Bluetooth audio source connected to it - it would use that as the audio source instead of Airplay.
Airplay requires users to be on the same WIFI network, but I would like to allow visitors with Bluetooth phones to be able to send music to my speakers. I am hoping for something automated. It means that I need to detect a Bluetooth audio connection and send a command to switch the audio source for the Airplay receiver software the Bluetooth receiver software. When the Bluetooth connection goes away - revert to the Airplay source.
I am planning on using a USB sound DAC to connect audio out to an amplifier.
Any suggestions? Thanks