Mac Mini as music server & Airplay audio receiver in Monterey, how does the Mac switch the audio source
I'm considering getting an M1 Mac Mini to use primarily as a hi res music server using locally stored FLAC files (probably JRiver) which will send audio to an external DAC over USB. But I also want to use this Mini as an Airplay receiver for iPhone audio, for streaming Spotify and podcasts etc. My question is, how does the Mac switch between playing local music files and receiving audio over Airplay? Is this done automatically? (The sound output will always stay on the external DAC). I've used Apple TV as an Airplay receiver and it automatically switches from it's apps to Airplay when it sees an Airplay signal. I'm hoping NOT to have to manually change the Mac Mini sound input each time I want to switch between playing music over JRiver and Airplay.