Sonos and Core

Hello,

I want to check if Sonos as a music player is playing at the moment, in core.

In need something like that:
IF Sonos is playing AND routine Good Night was executed
THEN stop playing

Can someone help?