Play One Song at a Time

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
raywood
Posts: 11
Joined: 20 Jan 2020 20:28

Play One Song at a Time

#1 Post by raywood » 28 Jan 2022 13:16

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?

AR Coding
Posts: 53
Joined: 02 May 2021 21:16

Re: Play One Song at a Time

#2 Post by AR Coding » 28 Jan 2022 14:33

how about:

Code: Select all

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

Aacini
Expert
Posts: 1885
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: Play One Song at a Time

#3 Post by Aacini » 29 Jan 2022 12:24

Simpler:

Code: Select all

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

raywood
Posts: 11
Joined: 20 Jan 2020 20:28

Re: Play One Song at a Time

#4 Post by raywood » 09 Apr 2022 10:13

Sadly, that produces this:

Code: Select all

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

AR Coding
Posts: 53
Joined: 02 May 2021 21:16

Re: Play One Song at a Time

#5 Post by AR Coding » 09 Apr 2022 20:51

Did you try my way?
Or

Code: Select all

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

Jer
Posts: 177
Joined: 23 Nov 2014 17:13
Location: California USA

Re: Play One Song at a Time

#6 Post by Jer » 10 Apr 2022 15:53

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

Post Reply