Merge pull request #102955 from adamscott/fix-web-audio-pause

[Web] Fix issue when pausing an non-started sample
This commit is contained in:
Thaddeus Crews
2025-02-18 07:56:07 -06:00

View File

@ -735,6 +735,9 @@ class SampleNode {
* @returns {void} * @returns {void}
*/ */
_pause() { _pause() {
if (!this.isStarted) {
return;
}
this.isPaused = true; this.isPaused = true;
this.pauseTime = (GodotAudio.ctx.currentTime - this._sourceStartTime) / this.getPlaybackRate(); this.pauseTime = (GodotAudio.ctx.currentTime - this._sourceStartTime) / this.getPlaybackRate();
this._source.stop(); this._source.stop();