From 510459477239a1f3692ad227bca31b6a28532a6a Mon Sep 17 00:00:00 2001 From: Viet Dinh <54ckb0y789@gmail.com> Date: Tue, 10 Dec 2024 19:45:55 -0500 Subject: [PATCH] Gracefully reset audio when resetting canvas --- src/platform/emscripten/interface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platform/emscripten/interface.cpp b/src/platform/emscripten/interface.cpp index 0cc3faf09..ba2956208 100644 --- a/src/platform/emscripten/interface.cpp +++ b/src/platform/emscripten/interface.cpp @@ -221,6 +221,8 @@ bool Emscripten_Interface_Private::UploadFontStep2(std::string filename, int buf } bool Emscripten_Interface::ResetCanvas() { + DisplayUi->GetAudio().BGM_Stop(); + DisplayUi->GetAudio().SE_Stop(); DisplayUi.reset(); DisplayUi = BaseUi::CreateUi(Player::screen_width, Player::screen_height, Player::ParseCommandLine()); return DisplayUi != nullptr;