From 030e7d4e2d5b0eb5769e6c064ac93c38987e3fa4 Mon Sep 17 00:00:00 2001 From: Adam Scott Date: Mon, 17 Feb 2025 09:46:13 -0500 Subject: [PATCH] [Web] Fix issue when pausing an non-started sample --- platform/web/js/libs/library_godot_audio.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/web/js/libs/library_godot_audio.js b/platform/web/js/libs/library_godot_audio.js index d0486279530..759d893fd94 100644 --- a/platform/web/js/libs/library_godot_audio.js +++ b/platform/web/js/libs/library_godot_audio.js @@ -735,6 +735,9 @@ class SampleNode { * @returns {void} */ _pause() { + if (!this.isStarted) { + return; + } this.isPaused = true; this.pauseTime = (GodotAudio.ctx.currentTime - this._sourceStartTime) / this.getPlaybackRate(); this._source.stop();