gpt4 book ai didi

batch-file - 如何批量循环播放音乐?

转载 作者:行者123 更新时间:2023-12-02 00:54:55 25 4
gpt4 key购买 nike

我已经获得了一些代码,可以让 wmplayer 在后台播放,但我无法让它在完成后自行循环播放。关于如何执行此操作的任何想法?

@echo off
set "file=GameMusic.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
exit /b

最佳答案

试试这个修改后的代码并给我你的反馈:

@echo off
set "file=GameMusic.mp3"
(
echo Set Sound = CreateObject("WMPlayer.OCX.7"^)
echo Sound.URL = "%file%"
echo Sound.settings.volume = 100
echo Sound.settings.setMode "loop", True
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
exit /b

编辑:第二个脚本应该可以试一试 ;)

@echo off
set "file=GameMusic.mp3"
( echo Set Sound = CreateObject("WMPlayer.OCX.7"^)
echo Sound.URL = "%file%"
echo Sound.settings.volume = 100
echo Sound.settings.setMode "loop", True
echo Sound.Controls.play
echo While Sound.playState ^<^> 1
echo WScript.Sleep 100
echo Wend
)>sound.vbs
start /min sound.vbs
exit /b

关于batch-file - 如何批量循环播放音乐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36524002/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com