Airplay busy flag

This is my first post here. I am new in coding and learned myself a little python. I managed to create a radio with a tuning knob to select radio streams. The tuning function has to be blocked to prevent starting mpd during airplay. If not both audio channels are active and will produce a sound mix. My question is where can I find a reliable value which can be used to indicate that airplay is going on. I want to pass this “value” to my python script.
Any suggestions?