均匀音量调节
This commit is contained in:
@@ -3,7 +3,7 @@ local rem=table.remove
|
||||
|
||||
local function fadeOut(id)
|
||||
local src=BGM.list[id]
|
||||
local v=src:getVolume()-.025*setting.bgm*.1
|
||||
local v=src:getVolume()-.025*setting.bgm*.01
|
||||
src:setVolume(v>0 and v or 0)
|
||||
if v<=0 then
|
||||
src:stop()
|
||||
@@ -12,9 +12,10 @@ local function fadeOut(id)
|
||||
end
|
||||
local function fadeIn(id)
|
||||
local src=BGM.list[id]
|
||||
local v=min(src:getVolume()+.025*setting.bgm*.1,setting.bgm*.1)
|
||||
local v=setting.bgm*.01
|
||||
v=min(v,src:getVolume()+.025*v)
|
||||
src:setVolume(v)
|
||||
if v>=setting.bgm*.1 then return true end
|
||||
if v>=setting.bgm*.01 then return true end
|
||||
end
|
||||
|
||||
local BGM={
|
||||
@@ -67,7 +68,7 @@ function BGM.play(s)
|
||||
end
|
||||
function BGM.freshVolume()
|
||||
if BGM.playing then
|
||||
local v=setting.bgm*.1
|
||||
local v=setting.bgm*.01
|
||||
if v>0 then
|
||||
BGM.playing:setVolume(v)
|
||||
if BGM.suspend then
|
||||
|
||||
Reference in New Issue
Block a user