Playing music and ambience audio

It's quite common for adventure games to make use of good music to immerse the player. This music will often need to play across scenes, so that there's no disruptive break in the audio.

AC's music system supports track crossfading, queuing, and playing across scenes - and have everything stored automatically in save game files. Ambience - background SFX - is handled in the same way.

Let's have some music play when our scene begins. If you haven't already, create a new "On Start" Custsene by clicking Create beside On Start in the Scene Manager:

Inside this Cutscene, create a new Sound: Play music Action. If you're using this Action for the first time, you'll see an information box at the top:

We need to assign some AudioClips as music tracks before we can play them using this Action. Click Music Storage window to bring up a window where we can assign some. Click Add new music clip a couple of times, and assign some AudioClips inside the two Clip boxes that appear:

If you need to, you can use the sliders to set the Relative volume that each clip is played at. The overall volume of these clips will be determined by your game's Music volume, which is available to change in your game's Options menu.

Close the Music Storage window and go back to the Sound: Play music Action. You'll see that the tracks we've just assigned are now available to select in the Music track popup box:

We can now use this Action to play some music. This music will play across scenes automatically. If you want to stop the music at any time, just use this Action again and set Music action to Stop.

You can also queue music so that one track only begins playing once the current track has finished. Just check Queue? on any subsequent track: