From 53a4f6ec94528400d7fa7ab9c2491e33f07e36c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=CC=81mi=20Parmentier?= Date: Sun, 12 Feb 2023 11:15:08 +0100 Subject: [PATCH] fix: music stop --- Source/Scripts/pico-8.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Scripts/pico-8.lua b/Source/Scripts/pico-8.lua index 8ca4182..ecd0d2f 100644 --- a/Source/Scripts/pico-8.lua +++ b/Source/Scripts/pico-8.lua @@ -189,6 +189,10 @@ function music(n, fade_len, channel_mask) fade_len = fade_len or 1000 channel_mask = channel_mask or 1 + if n == -1 and musicPlayer ~= nil and musicPlayer:isPlaying() then + musicPlayer:stop() + end + if data.music[n] ~= nil then if musicPlayer == nil then musicPlayer = playdate.sound.fileplayer.new(data.music[n])