This is my code:
@echo off
set "file=TobuMusic.mp3"
( echo Set Sound = CreateObject("WMPlayer.OCX.7"^)
echo Sound.URL = "%file%"
echo Sound.Controls.play
echo do while Sound.currentmedia.duration = 0
echo wscript.sleep 100
echo loop
echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sound.vbs
start /min sound.vbs
I've downloaded a song from the music producer 7obu (Tobu) online, and I want to play the song on a batch file. This code helped a lot, but I don't understand how I can make it exactly 10 seconds long.
How can I achieve it?