gpt4 book ai didi

batch-file - 如何从lua脚本运行批生产线

转载 作者:行者123 更新时间:2023-12-02 23:01:20 25 4
gpt4 key购买 nike

如何使其运作。我试图通过lua脚本从批处理中运行声音

batch = [[
@echo off
set "file=wuuf.wav"
(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
]]

local p = io.popen([[cmd /c ]]..batch)

最佳答案

local script = [[
Set Sound = CreateObject("WMPlayer.OCX.7")
Sound.URL = Wscript.Arguments(0)
Sound.Controls.play
do while Sound.currentmedia.duration = 0
wscript.sleep 100
loop
wscript.sleep Sound.currentmedia.duration*1000+100
]]
local f = io.open("sound.vbs", "w")
f:write(script)
f:close()

local file = "wuuf.wav"
os.execute('wscript sound.vbs "'..file..'"')

关于batch-file - 如何从lua脚本运行批生产线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64572856/

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