How to make music play in background of batch game

前端 未结 4 1605
抹茶落季
抹茶落季 2021-01-07 02:16

I am making a batch game in notepad and I was wondering how I can play the file music in the background.

I have this:

@echo off
start Music.mp3         


        
4条回答
  •  无人及你
    2021-01-07 02:49

    You can also play online music like this script :

    @echo off
    Title Listen to the music with batch and vbscript
    mode con cols=60 lines=3 & color 9E
    echo.
    Echo           To stop the music just close this window 
    set "file=http://www.chocradios.ch/djbuzzradio_windows.mp3.asx"
    set "vbsfile=%tmp%\%~n0.vbs"
    ( 
        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
    )>%vbsfile%
    cscript /nologo %vbsfile%
    

提交回复
热议问题