We'll begin by implementing the simplest form of game audio: two-dimensional stereophonic audio. We'll start with menu sound effects and then move onto music and classic ambient soundscapes.
The first thing we need to do is import some audio files into the project. Find the ButtonClick.wav
and the ButtonHover.wav
files included with this chapter and drag them into a new folder in your Project window called Audio
. You'll know that they're valid audio files from their yellow waveform icon:
Note
Files with the .wav
extension are one of the many supported audio file types in Unity. You can also import .mp3
, .ogg
, .aif
, .mod
, .it
, .s3m
, and .xm
.
Next, we'll create a script that we can use to play these sounds when either of the buttons on the main menu are selected.