Plugin to get audio signal from Spotify or Amazon Music

Hey folks,

does anyone have a glue, if there is a possibility to get the audio signal of a playing stream from Spotify and/or Amazon Music. The app should run in the background and I would have to be able to get information about the BPM.

Please let me know, if someone has an idea if this is possible at all.

Thanks in advance,
Oliver