Why does xp not play music in dos games?”
It’s a minor miracle that you get any sound at all! All DOS games had to talk directly to the sound hardware. To get this to work under XP, the XP DOS box has to pretend to be a 1988 SoundBlaster card and it has to translate the commands for that ancient sound card into commands to drive your current sound system. To get music, XP has to emulate the very cheesy Yamaha MIDI synthesizer. This often requires some custom environment variables to be set. You may have to Google for “wolfenstein midi on XP” and see what the world has figured out.