music – Other party cannot hear audio played during call

While making a call, I can play music through Spotify or VLC.
When I put the call on loudspeaker and play music, I can hear both the caller and the music.
But the other party can only hear my voice and not the music.
Why is this happening? How is the device selectively transmitting only my voice and not the music?