Using the Sound and SoundChannel classes I can load and play a sound asset in my HTML5 project. If allowed to play till the end, the sound stops automatically since 0 loops are specified. But this.channel.stop() has no effect, neither does this.sound.close(). Setting both of those to null also has no effect. Removing the screen that initiated the sound doesn’t remove the sound.
I based my code on the PlayingSound example. But the PlayingSound example actually doesn’t work. Clicking on the background doesn’t pause the sound as it supposed to. It only fades the sound out. Clicking the background not only fades the sound back in but also adds another copy of the same sound and the two sounds are out of sync.