Page 1 of 1

Play One Song at a Time

Posted: 28 Jan 2022 13:16
by raywood
I have a playlist. I use IrfanView as my default audio player. It plays one song at a time.

My prototype batch file goes like this:

Code: Select all

start "" "Song 1.mp3"
pause
start "" "Song 2.mp3"
pause
start "" "Song 3.mp3"
pause
When I run the batch file, Windows ignores the pause commands. It starts one song, immediately starts the next song (stopping the first), and so forth. IrfanView ends up playing only the last song.

Originally, I had it as start [song] & pause, but that did the same thing.

What am I missing?

Re: Play One Song at a Time

Posted: 28 Jan 2022 14:33
by AR Coding
how about:

Code: Select all

start "" /wait "Song 1.mp3"
start "" /wait "Song 2.mp3"
start "" /wait "Song 3.mp3"

Re: Play One Song at a Time

Posted: 29 Jan 2022 12:24
by Aacini
Simpler:

Code: Select all

"Song 1.mp3"
"Song 2.mp3"
"Song 3.mp3"

Re: Play One Song at a Time

Posted: 09 Apr 2022 10:13
by raywood
Sadly, that produces this:

Code: Select all

'"Song 1.mp3"' is not recognized as an internal or external command, operable program or batch file.

Re: Play One Song at a Time

Posted: 09 Apr 2022 20:51
by AR Coding
Did you try my way?
Or

Code: Select all

start "" /wait "C:\path\to\IrfanView.exe" "C:\path\to\Song 1.mp3"
...
...

Re: Play One Song at a Time

Posted: 10 Apr 2022 15:53
by Jer
Didn't know about irfanview playing audio files and I just hammered this
out until it worked. Another part of this scheme could be to sort
the playlist in random order before playing.
Jerry

Code: Select all

@echo off
setlocal
set "musicpath=c:\music\"
set "pListpath=%muspath%myplist.m3u"
set "prg=c:\program files\irfanview\plugins\iv_player.exe"

pushd "%musicpath%"
>"%pListpath%" (For /F "tokens=*" %%s In ('dir /b "*.mp3"') Do echo %%s)
start "" "%prg%" "%pListpath%"
popd

endlocal & exit /b