From 032043f03aca914eff8488841b55268144c27b00 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Sat, 20 Apr 2024 16:58:09 +0800 Subject: [PATCH] =?UTF-8?q?fmod=E6=A8=A1=E5=9D=97=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=A4=E4=B8=AAplay=E5=87=BD=E6=95=B0=E7=9A=84=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E6=96=B9=E5=BC=8F=20=E4=BF=AE=E5=A4=8D=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E9=9F=B3=E9=A2=91=E9=AB=98=E7=BA=A7=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=97=B6=E9=87=8D=E5=90=AF=E9=9F=B3=E9=A2=91=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=90=8E=E9=9F=B3=E9=87=8F=E8=AE=BE=E7=BD=AE=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/fmod20221/init.lua | 8 ++++++++ assets/scene/setting_out.lua | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/assets/fmod20221/init.lua b/assets/fmod20221/init.lua index 48e4a7fb..b53ed31d 100644 --- a/assets/fmod20221/init.lua +++ b/assets/fmod20221/init.lua @@ -100,6 +100,7 @@ end -------------------------- +---@type table|fun(name:string, args:{instant?:boolean, volume?:number, pitch?:number, tune?:number, fine?:number, pos?:table, param?:table}):FMOD.Studio.EventInstance? M.music={} ---@param v number @@ -210,8 +211,12 @@ function M.music.getPlaying() return playing.event end +local playMusic=M.music.play +setmetatable(M.music,{__call=function(_,...) playMusic(...) end}) + -------------------------- +---@type table|fun(name:string, args:{instant?:boolean, volume?:number, pitch?:number, tune?:number, fine?:number, pos?:table, param?:table}):FMOD.Studio.EventInstance? M.effect={} ---@param v number @@ -309,6 +314,9 @@ function M.effect.stop(name,instant) end end +local playEffect=M.effect.play +setmetatable(M.effect,{__call=function(_,...) playEffect(...) end}) + -------------------------- M.vocal={} diff --git a/assets/scene/setting_out.lua b/assets/scene/setting_out.lua index ffa433ae..a9579eb0 100644 --- a/assets/scene/setting_out.lua +++ b/assets/scene/setting_out.lua @@ -79,8 +79,10 @@ scene.widgetList={ {name='2',type='slider', pos={0,0},x=340, y=800,w=650, fontSize=30,text=LANG'setting_fmod_DSPBufferLength', widthLimit=260, axis={3,16,1},valueShow=function(S) return 2^S.disp() end, disp=function() return MATH.roundLog(SETTINGS.system.fmod_DSPBufferLength,2) end, code=function(v) SETTINGS.system.fmod_DSPBufferLength=2^v end}, {name='2',type='button', pos={0,0},x=400, y=870,w=140, h=60,fontSize=30,text=LANG'setting_apply', code=function() FMODLoadFunc() - debug.setupvalue(getBgm,1,nil) + FMOD.setMainVolume(SETTINGS.system.mainVol,true) + stopBgm() PROGRESS.playExteriorBGM() + FMOD.effect.play('beep_notice') end}, -- Video