Page 1 of 1

Help With JukeBox

Posted: 19 Sep 2011 20:48
by kami
I an trying to create something like a JukeBox where the user is able to select from a list of tracks and it plays. I would also love if the track could repeat over and over until the user wants it to stop.

I have the .wav files which i have named each ones by numbers(1-9) in a folder called JukeBox which also contains the batch file also calle JukeBox on my desktop.

I am running windows 7 and when i try to run the little piece of code I have it says "mplay32.exe", "wmplayer32.exe" or the word "play" is not recognised.

Can someone please help...pretty please?

This is the little i have so far.

Code: Select all

@echo off
:start
cls
echo.
echo            WELCOME To JUKEBOX WORLD
echo          ----------------------------
echo.
echo Select 1-9 for the track you wish to play
echo.
set "choice="
set /p choice=Please enter your prefered track:
rem %choice%.wav
echo.

start %choice%.wav

Play sound
mplay32.exe/play/close/JukeBox\%choice%.wav

echo.
pause
type %choice%.wav | more
pause
goto :start
pause

Re: Help With JukeBox

Posted: 19 Sep 2011 22:41
by Ed Dyreen
'
How about:

Code: Select all

start "mplay32" /low /min "mplay32.exe" "%choice%.wav" /play /close /JukeBox

Re: Help With JukeBox

Posted: 20 Sep 2011 16:05
by kami
nah doesn't work either :(

Re: Help With JukeBox

Posted: 20 Sep 2011 19:02
by nitt
kami wrote:nah doesn't work either :(


It's not "wmplayer32", it's just "wmplayer".

Re: Help With JukeBox

Posted: 20 Sep 2011 19:48
by kami
yh man. doesnt work :(

Re: Help With JukeBox

Posted: 20 Sep 2011 21:27
by Captcha142
I have a simple "chimes.bat" in my archive;
try

Code: Select all

mplay32 /play /close c:\windows\media\flourish.mid

To play the flourish track from XP.
If

Code: Select all

mplay32 /play /close c:\JukeBox\%choice%.wav

doesn't work, try changing the file extensions... mplay doesn't play many file types.

Re: Help With JukeBox

Posted: 21 Sep 2011 05:36
by kami
This is what i did instead. I think the IF statements need to be corrected...but so far it works ok.

Code: Select all

@echo off
color FC
:start
cls
echo.
echo            WELCOME To JUKEBOX WORLD 2.0
echo          --------------------------------
echo.
echo Music Selection
echo Options
echo   1. Keida - Bubble up
echo   2. Camar - Pole Technician
echo   3. Katy Perry - Firework
echo   4. Wande Coal - Bumper 2 Bumper
echo   5. I-Octane - Study yuh friend
echo.
echo Video Selection
echo Options
echo   6.
echo   7.
echo.
echo.
echo If you wish to exit please press E
set choice=
echo Select 1-9 for the track you wish to play
echo.

set /p choice=Please enter your prefered track:
rem %choice%.mp3

if "%choice%" =="1" (start 1.mp3)
if "%choice%" =="2" (start 2.mp3)
if "%choice%" =="3" (start 3.mp3)
if "%choice%" =="4" (start 4.mp3)
if "%choice%" =="5" (start 5.mp3)
echo.
pause
rem type %choice%.mp3 | more
goto :start
pause

Re: Help With JukeBox

Posted: 21 Sep 2011 12:51
by Ed Dyreen
'
next code:

Code: Select all

if "%choice%" =="1" (start 1.mp3)
if "%choice%" =="2" (start 2.mp3)
if "%choice%" =="3" (start 3.mp3)
if "%choice%" =="4" (start 4.mp3)
if "%choice%" =="5" (start 5.mp3)
can be replaced by:

Code: Select all

for /l %%! in (

  1, 1, 5

) do if /i ["%choice%"] == ["%%~!"] (
  ::
  start "mp3" "%%~!.mp3"
)
:wink:

Re: Help With JukeBox

Posted: 21 Sep 2011 16:49
by kami
Yaaaaay. Thank you guys :D .

How do i display an error message if the user enters a wrong option?