Stop sounds from overlapping

I’m currently working on a game where you play various songs that are randomly chosen from a list by clicking the mouse button.
However, playing songs in quick succession before they end causes them to overlap. How do you set the audio so that it stops whatever song is currently playing before starting a new one?

If you use an AudioComponent to play the audio, you can stop it and change the sound you want it to play, that way it’ll never overlap sounds :wink:

Use a sound concurrency class.