Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/components/canvas/players/audio-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export class AudioPlayer extends Player {

this.getContainer().alpha = 0;

if (!this.audioResource) {
if (!this.audioResource || this.audioResource.state() !== "loaded") {
this.isPlaying = false;
return;
}

Expand All @@ -82,7 +83,8 @@ export class AudioPlayer extends Player {
this.audioResource.volume(this.getVolume());
}

if (this.audioResource.rate() !== speed) {
// Howler's rate getter dereferences the first sound, which may not exist after teardown.
if (this.audioResource.playing() && this.audioResource.rate() !== speed) {
this.audioResource.rate(speed);
}

Expand Down
Loading