Allow only one sound to play until complete

I’m working on an app that allows sounds to play when certain objects are selected. Phaser 3.16.2. While the audio plays fine, I’m not getting a notification that it has stopped.

public playSong(): void {
	if (!this.soundPlaying) {
		this.soundPlaying = true;
		const song = this.sound.add("song_1");
		// These both display an accurate number
		console.log(song.duration);
		console.log(song.totalDuration);
		song.on("ended", (sound) => {
			// None of the following triggers
			console.log("ended");
			this.soundPlaying = false;
			setTimeout(() => {
				this.sys.game.destroy(true);
			});
		});
		console.log("Play Song");
		song.play();
	}
}

Some code based upon http://labs.phaser.io/edit.html?src=src\audio\Web%20Audio\Reuse%20AudioContext.js

There’s approximately 30 sounds I might be playing, so I’m trying not to create a property on the scene for each sound.

What am I missing?

https://photonstorm.github.io/phaser3-docs/Phaser.Sound.Events.html#event:COMPLETE

Duh.

So given that it works in the example, is this just part of what Rich did in 3.16 around events, and the labs example needs to be updated (now that I’m looking at the console, it is running 3.15)?

Yes, it was renamed in v3.16.