This article will explain how to play music on Twitch, what music is safe, and what music is copyrighted (and can get you in trouble).
How to Play Music on Twitch Without Copyright (OBS/Streamlabs)
There are a number of ways to play background music on a Twitch stream. If your stream is configured to output the same audio output that you hear through your headphones, you can simply load up a YouTube video or a music player like Spotify, start playing a song, and it will play on your stream. If you're streaming from a console, you can do the same thing by launching an app like Spotify on your console, playing a song, and then returning to your game.
If you’re using broadcast software like OBS, you can also use an app like Spotify as a source and then add that to your OBS scene. This works much the same as adding a game to OBS, but you can overlay your game with a Spotify mini-player if you want.
Here's how to add Spotify to your Twitch stream in OBS: