Skip to content

Playing background music tracks from Enhanced CDs

Matt Jernigan edited this page Oct 24, 2022 · 15 revisions

On the latest Windows versions, some games are starting to fail to find and play the Red Book audio tracks on Enhanced CDs. These tracks are typically used for background music (bgm). For example, CyberStorm, on Windows 10, will play one track once, in game, but fail to move to the second track and loop the playlist. Furthermore, CD-ROM drives are becoming less common these days forcing a new solution regardless of the game's ability to play the tracks from the CD.

Presented below are some workarounds to this situation 💥FOR DARING USERS ONLY💥.

Ripping Tracks

Before you can escape from your CD you must, of course, rip the audio tracks from it to your preferred audio file format. This wiki does not cover how to rip. Most readers probably already know exactly what to do here but, if you don't, there are plenty of other resources out there for that. If you don't have your favorite ripper already installed, Windows Media Player can rip Enhanced CDs just fine. There are a jillion rippers out there so, if you want some other ripper suggestions, I use Exact Audio Copy when I'm feeling dweeby about audio and/or disc purity, and foobar2000 the rest of the time. All free. I prefer well-built appliances over pretty gizmos even though some of those gizmos are friendlier to novice users.

Mod Tools: _inmm.dll and ogg-winmm

💥FOR SEMI-ADVANCED USERS💥

_inmm.dll is more than a file but also the name of a set of tools by Irori for modding your game's EXE to play and loop local media files instead of files or CD-DA tracks off of the CD. It does this by replacing calls to Microsoft's standard DLL, WINMM.DLL, with calls to their own _inmm.dll. Hence, the strange name.

Here's a guide in English by Play-Old-PC-Games.com:

I don't know much about this tool yet and will post more as I learn more. @blam has reported that _inmm.dll breaks joystick support in EarthSiege II.

It may help to know that "Collector" of The Sierra Help Pages has created some new installers that not only rip (or download from his server) the CD-DA tracks for you, but also use this tool to modify the game for you. In particular, I know his Metaltech: Earthsiege II 32-bit Installer does this. So, look there for any solutions he may already have or, perhaps, ask him to create one.

ogg-winmm is based on the same idea as _inmm.dll but instead provides a modded WINMM.DLL file for playing music tracks ripped to OGG files. Maximilien Noal appears to have the latest fork of ogg-winmm and has reported that at least one of his later versions works with CyberStorm. @blam has also reported that Maximilien's ogg-winmm v18.09 works with EarthSiege II.

Thus, ogg-winmm appears to be the best bet with Sierra/Dynamix games. I have yet to test the latest versions myself. Take note of Maximilien's "PROTIP" in his readme. Thus far, it appears Sierra EXE files need to be modified to find WINMM.DLL under a different name (such as the suggested rename of WINMX.DLL). This would be due to a program's preference to load the system WINMM.DLL instead of the local one. And, thus, the need to rename the DLL and to mod the EXE. Hint: Use a hex editor to search for "WINMM.DLL" and change it to "WINMX.DLL" (or something else of the same length -- I would go with "OGGMM.DLL" personally).

Batch Files for BGM and Game Launching

💥FOR ADVANCED USERS ONLY💥

These batch files assume your game is good with looping all audio tracks. If your game uses specific tracks for specific levels of the game, then you will need to be much more creative than what these batch files provide. You could, for example, set the repeat to just one track and then use a tool like AutoHotKey to set different tracks to different hotkeys. But that sounds like too much trouble when you could Alt+Tab over to your music player and switch tracks that way. Really, that sounds like too much trouble too and you should look for solutions like what I described above at The Sierra Help Pages.

Some advantages with these batch files:

  • Batch files always work if the tools you are calling work. Installers/patches sometimes break for mysterious reasons.
  • You can define your own playlists. For example, CyberStorm, as originally made, loops the first two tracks in game and the third track is the menu track. By setting up your own playlists here, you have the option to loop all three tracks in game... or even grab the four tracks from CyberStorm 2 and loop all seven. Maybe even do random or shuffle looping.

⚠️ You need to be comfortable with reading and editing batch files (a type of text file) for any of this to work for you. That, too, is beyond the scope of this wiki and site. Beware of working with the line-continuation character: ^.

Here are three batch file options...

1. Least Flexible: Windows Media Player

I include this only because WMP is built in and you may find this good enough.

This is fairly limited compared to the others because you cannot set it to startup in paused mode, cannot set loop type, and cannot set the volume from the batch file. You must set WMP to loop before launching this batch file.

CSTORM-WMP.bat
SETLOCAL ENABLEEXTENSIONS

REM NOTE: Must previously set WMP to repeat.  Cannot do it from command line.

START "" "%ProgramFiles%\Windows Media Player\wmplayer.exe" ^
  "%CD%\CyberStorm - Audio Track 01.mp3" ^
  "%CD%\CyberStorm - Audio Track 02.mp3" ^
  "%CD%\CyberStorm - Audio Track 03.mp3"

REM Alternatively, play a playlist:
REM START "" "%ProgramFiles%\Windows Media Player\wmplayer" /Playlist "CyberStorm"

REM TIMEOUT 1 /NOBREAK
cstorm.exe

REM Alternatively, call another batch file that starts the game:
REM CALL CSTORM-1360x768.bat

TASKKILL /IM wmplayer.exe /T /F

An alternate exit command is:

TASKKILL /FI "WINDOWTITLE eq Windows Media Player" /T /F

2. Pretty Good: foobar2000

Foobar is a little frustrating to control from the command line (because it doesn't have what I would call a genuine command line interface) but it works. See the REM comments in the file. Foobar also often stays in front of what may load next so you may have to look for the game in the taskbar and switch to it manually. Furthermore, if loading a playlist file instead of tracks, you need to give it time to load with a TIMEOUT 1 command.

⚠️ This batch file assumes you want to start the game with the playlist paused. You can change it if you want otherwise (delete or REM out the line with /stop in it). This is because I don't need background music in the menus, and some games, like CyberStorm, have background music in the menus regardless of the CD. Thus, two layers of music would be annoying.

Foobar requires setting your global hotkeys in the program before using these batch files. I set mine to this:

  • File >> Preferences >> Keyboard Shortcuts >> Add new:
    • Playback / Play or pause: Shift+Ctrl+M [x] Global hotkey
    • Playback / Volume / Up: Shift+Ctrl+Up [x] Global hotkey
    • Playback / Volume / Down: Shift+Ctrl+Down [x] Global hotkey
  • Actually, this was my favorite before finding out that VLC couldn't duplicate this:
    • Playback / Play or pause: Ctrl+Alt+M [x] Global hotkey
    • Playback / Volume / Up: Ctrl+Alt+. [x] Global hotkey
    • Playback / Volume / Down: Ctrl+Alt+, [x] Global hotkey
  • Do whatever works for you.

ℹ️ Run the batch and then hit Ctrl+Shift+M to start the music when in the game. Hit it again to pause the music.

( If you are looking for an option to control looping of a single track for specific levels, you may want to set hotkeys for Next and Previous as well. )

CSTORM-foobar2000.bat
SETLOCAL ENABLEEXTENSIONS

REM NOTE: Setting volume and repeat order here will stick outside of this batch session.
REM See the bottom exit line to set things back to your preferences on exit.

REM Replace /command:"Repeat (playlist)" with /rand or /command:"Shuffle (tracks)" if you desire.
REM Use /command:"Repeat (track)" to repeat just one track.

START "" "%ProgramFiles(x86)%\foobar2000\foobar2000.exe" /immediate ^
  /command:"Repeat (playlist)" ^
  /command:"Set to -9 dB" ^
  "%CD%\CyberStorm - Audio Track 01.mp3" ^
  "%CD%\CyberStorm - Audio Track 02.mp3" ^
  "%CD%\CyberStorm - Audio Track 03.mp3"

REM Alternatively, play a playlist:
REM START "" "%ProgramFiles(x86)%\foobar2000\foobar2000.exe" /immediate ^
REM   /command:"Repeat (playlist)" ^
REM   /command:"Set to -9 dB" ^
REM   "%CD%\CyberStorm.fpl"
REM TIMEOUT 1 /NOBREAK

REM Stop is better than pause in case of TIMEOUT or other slowness.
"%ProgramFiles(x86)%\foobar2000\foobar2000.exe" /stop

REM TIMEOUT 1 /NOBREAK
cstorm.exe

REM Alternatively, call another batch file that starts the game:
REM CALL CSTORM-1360x768.bat

"%ProgramFiles(x86)%\foobar2000\foobar2000.exe" /exit ^
  /command:"Default" ^
  /command:"Set to -0 dB"

An alternate exit command is:

TASKKILL /IM foobar2000.exe /T

( Foobar doesn't like TASKKILL /F (it complains on restart). It is too difficult to kill foobar via TASKKILL /FI "WINDOWTITLE eq GuessTheName*" /T. )

3. Most Flexible: VLC media player

The nice thing about VLC is nothing set on the command line sticks outside of the batch session. Not even the global keys.

⚠️ This batch file assumes you want to start the game with the playlist paused. You can change it if you want otherwise (delete --no-playlist-autostart or change it to --playlist-autostart). This is because I don't need background music in the menus, and some games, like CyberStorm, have background music in the menus regardless of the CD. Thus, two layers of music would be annoying.

ℹ️ Run the batch and then hit Ctrl+Shift+M to start the music when in the game. Hit it again to pause the music.

( If you are looking for an option to control looping of a single track for specific levels, you may want to set hotkeys for --global-key-next and --global-key-prev as well. )

CSTORM-VLC.bat
SETLOCAL ENABLEEXTENSIONS

REM Replace --loop with --random if you desire.
REM Use --repeat to repeat just one track.
REM Doesn't work for me: --waveout-volume=0.7 ^

START "" "%ProgramFiles%\VideoLAN\VLC\vlc.exe" ^
  --qt-start-minimized --qt-notification=0 ^
  --loop ^
  --directx-volume=0.7 ^
  --no-playlist-autostart ^
  --global-key-play-pause="Ctrl+Shift+m" ^
  --global-key-vol-up="Ctrl+Shift+Up" ^
  --global-key-vol-down="Ctrl+Shift+Down" ^
  "%CD%\CyberStorm - Audio Track 01.mp3" ^
  "%CD%\CyberStorm - Audio Track 02.mp3" ^
  "%CD%\CyberStorm - Audio Track 03.mp3"

REM Alternatively, play a playlist (requires hitting play twice to start):
REM The playlist-tree causes the first track to be skipped for some reason.
REM  --no-playlist-tree ^
REM  "%CD%\CyberStorm.xspf"

REM TIMEOUT 1 /NOBREAK
cstorm.exe

REM Alternatively, call another batch file that starts the game:
REM CALL CSTORM-1360x768.bat

TASKKILL /IM vlc.exe /T /F

( It is too difficult to kill VLC via TASKKILL /FI "WINDOWTITLE eq GuessTheName*" /T. The special stream vlc://quit doesn't work in a way that applies here. )

Others

There are, certainly, other media players out there that you can control like this. Knock yourself out using them. This is all I cared to find time for to test and write up (which takes a surprising amount of time). I looked at WinAmp briefly and saw various plugins for command line control (and not much control built in). Several links were dead and I wasn't about to try to sort through it all. I also looked into Media Player Classic briefly and determined that it won't get you much further than Windows Media Player.

Also, just about anything is possible if you are willing to write AutoHotkey scripts to help control any of the above mentioned players.