From ee291f2bb86851ac1ad7c1f2a285d6cb925e0220 Mon Sep 17 00:00:00 2001 From: "Daniel A. Nagy" Date: Sun, 30 Nov 2025 16:49:34 +0100 Subject: [PATCH] Stop already playing sample before playing again Allows for playing more fequently than the duration of the sample. --- src/util/audio.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/audio.lua b/src/util/audio.lua index 6e16eab7..7b005ce1 100644 --- a/src/util/audio.lua +++ b/src/util/audio.lua @@ -27,6 +27,7 @@ for _,name in pairs(names) do local filename = "assets/sounds/"..name..".ogg" local source = love.audio.newSource(filename, "static") audio[name] = function() + love.audio.stop(source) love.audio.play(source) end end