Set GPIO pin high when audio is playing and low when audio is stopped

Hi there, i’m trying to switch a relais to power up my amp when sound is playing. Audio is playing on my DAC. The DAC is audio card 1. The pin I want to switch is GPIO4 (pin 7). How can I get this to work. Can someone help me with this?

Thanks in advance

Is there someone who can help me with this?

Hello! How is the DAC connected to your Raspberry Pi? Is it through USB? If so, you could probably use Python (or a preferred language) to read data coming in from the serial port and then use it to switch the GPIO pins. Can you provide a schematic or the type of DAC which you are using?