diff --git a/lib/audio.lua b/lib/audio.lua index 465f72a..58d0e22 100644 --- a/lib/audio.lua +++ b/lib/audio.lua @@ -40,7 +40,7 @@ end --- @param ms number? in milliseconds function audio:crossfade(from, to, ms) print("[Audio]: Triggered crossfade") - + -- Stop previous 'from' if it's dangling to avoid leaks if self.from and self.from ~= from and self.from ~= to then self.from:stop() @@ -54,7 +54,7 @@ function audio:crossfade(from, to, ms) -- Reuse fader object to allow task cancellation if not self.fader then self.fader = { value = 0 } end self.fader.value = 0 - + task.tween(self.fader, { value = 1 }, ms or 1000, ease.easeOutCubic)(function() if self.from then self.from:setVolume(0)