@echo off
::for custom background music, please use WAV (Microsoft) with IMA ADPCM
::in 16 kHz
set file=%1
if "%2"=="blue" color 1f
setlocal EnableDelayedExpansion EnableExtensions
path=%path%;%cd%\dll
cd snd
:loop
if "%file%"=="" goto aproblem
if "%file%"=="weed" goto arealproblem
if not exist "%file%.snd" goto aproblem
@echo.>>loaded
bg.dll play %file%.snd 1
bg.dll stop %file%.snd
if exist exitplease exit
goto loop

:arealproblem
echo.
echo Audio playback failure
echo.
echo Reason: Too much weed m9
echo.
goto :eof

:aproblem
echo.
echo Audio playback failure
echo.
echo Make sure that the file in the argument exists.
echo Check for any typos. Do not launch this file
echo as of itself: it won't get you far.
echo.
Pause