I had a right problem with this I tried everything I could think of then after a call with the Samsung technician we identified it's the music file formats. I wondered why some of my music library would play but the majority not you need to convert all your music files.
The fix - On your laptop download "MediaHuman Audio Converter" for Windows mine was 8.1 I found this a great app and very quick and easy to use follow the instructions. Next open Windows Media Player and in your files open the "Music" folder you will need to convert all your music files to MP3 format an album or artist at a time it's long process if you have 200+ albums!
On your S21 go into Samsung "My Files" then "Audio Files" you need to delete all your music files ready to start from scratch. I tried converting all my files to MP3 using my phone but found I was left with a huge list of music without any album categories and I couldn't export them from the app file to my "Audio" file so chose to tackle it using my laptop.
When you start converting your files leave they will duplicate in Media Player leave the WMA files in their folders with the new MP3 file. Plug in your S21 ready to SYNC your music, once you have converted an album find it in Media Player and add the new MP3 file to the SYNC list and Sync your music as you go along. It's slow if you have a lot of music, be warned if you select all in your SYNC list it will also add all the other music file formats you have ripped and eat up your memory.
Good luck I got there in the end, but why can't Samsung just update the software to play all files very frustrating!
Don't think the problem is Samsungs, it is that WMA files are developed by Microsoft so are designed to be played on the Windows format and not Android.
So you would need the appropriate Codecs to be able to play theses files on Android.
VLC seems to be a good player for playing all types of files, there are also WMA players in the google store or just convert your files to M4A or MP3 format
I have a solution! It's a long one but it's worth it so you don't have to wait for samsung to fix the problem..
1st download Mp3 video converter from Google play. once you download it open it and click on the "music" option,once there click on the song and put convert and bam! The song will be playable now
Alright after tons of digging as many have brought up the issue is definitely WMA files. Android hasn't officially supported them ever HOWEVER. Samsung has all the way up until the release of the S21. They dropped the codec from the OS. While the work arounds are there they don't address the issue of apps not supporting the WMA format and looking to the Operating system for a codec. This is a rather large issue for people who use alarm apps and have it set to play a random song. After I "upgraded" to my S21 ultra my alarm stopped going off half the time because if it shuffled to a WMA song it would just not play. This made for some bad mornings at work. I went to my library on my PC and found my original files were in the M4a format. At some point my songs got converted to WMA when being transferred from my PC to Galaxy or on one of my last galaxy devices. So the fix for me was as simple as dragging and dropping the OG files in place of the ones on the phone. But if your original files are WMA I would recommend converting them to MP3 or M4A with a converter online.
Same problem. NOT a licensing problem. The files I can't play are all MP3s. It plays some, but not others. I guess it's unreasonable to expect a thousand dollar phone to be able to do what an eight-year-old Galaxy S4 could do.