Adding sound - a beginner's guide

Favourite 109 favourites
Tutorial written by VelojetOriginally published on 13th, December 2011 - 9 revisions

It takes three simple steps. Here they are, followed by detailed instructions, and a walkthrough showing how you can add sounds to the Beginner's Guide tutorial:

1) Import sound files into your project.
2) Insert an Audio object to your project.
3) Add sound events in the event sheet.

1) Import sound files into your project

In the Project Bar (on the right of the workspace - if it's not visible, click the Project tab at bottom right), right-click the Sounds or Music folders and select 'Import sounds' or 'Import music'.

Import sounds
How do you decide which folder to import your files into? Audio files in the Sounds folder are downloaded completely before they're played, while files in the Music folder are streamed (played as they're downloading). So, if you put a music track in the Sounds folder, it would need to take time to download completely before playing, but if it's in the Music folder, it can start playing immediately while it's streamed.

Sound FX files


Select the sound files you need:

Import audio files
Preferably, import WAV files (in PCM encoding). Construct 2 will automatically encode these to both Ogg Vorbis and MPEG-4 (MP4) files. (Why are both formats needed? You can find the reason here in the Manual, and more details of HTML5 audio formats here and even more, including the politics - yes! - of audio formats here. And why can't you use MP3 files? Because of licensing issues - read more about them here.)

2) Insert an Audio object to your project

Right-click in the layout sheet. In the dialog that opens, select 'Insert new object'.

Under 'Media', select 'Audio' and click 'Insert'.

Insert Audio object


In the Project Bar, an Audio object will appear under 'Object types', and its properties will appear in the Properties Bar (on the left of the layout sheet).

Properties Bar - Object types

3) Add sound events in the event sheet

Now, by way of example, here's how we add sounds to the Beginner's Guide tutorial game:

First, we import the sound files we want - bullet fire, an explosion for when a bullet monster is destroyed, a different explosion for when your player is destroyed, and a victory sound for when your player wins. We're taking our sound files from the free bundle download of music, sounds and sprites - for the bullets firing we'll use Lazer Fire 1.wav, for the monster destruction we'll import Explosion 3.wav, for the player destruction RetroLaser1.wav (it's got a suitably dismal quality), and SquareMotif1.wav for the celebration of victory. Import these and you'll see their .ogg and .m4a versions showing up in the Sounds folder in the Project Bar.

Project Bar - Sounds folder
Now we insert an Audio object.

Lastly, we add the sound events:

Action: Play Lazer Fire



Action - Play Explosion
Open full size image


Action - Play RetroLaser1
There's still the victory celebration sound to add. Over to you - along with other sounds you may want to add. (What about a sound when a monster runs out of health and it's destroyed?)

You should now find that the game is noisier - and more fun.

Unlock your full gamedev potential

Upgrade to the Personal Edition of Construct 2, it has way more features and won't holding back from making money and using your full creativity like the free edition does. It's a one off payment and all Construct 2 editor updates are free for life!

View deals

Plus, it's got a lot of additional features that will help you save time and make more impressive games!

Congratulations on finishing this tutorial!

Did you learn a lot from it? Share it now with your friends!

Comments

13
Bigheti 17.4k rep

The first thing I did was the Begginers Tutorial and now I know more about sounds and music with this explanation. Tks!

Tuesday, December 13, 2011 at 9:42:23 AM
4
kenny56 2,768 rep

At first i was having problems,but it was a beginners mistake.Thanks for the info.

Wednesday, January 04, 2012 at 6:28:27 PM
4
WASD 2,548 rep

Thank you, very well written.

Thursday, April 19, 2012 at 5:36:46 PM
1
Velojet 21.3k rep

@Bigheti @kenny56 @WASD
Thanks very much for your positive feedback - always happy to know a tutorial has helped someone!

Thursday, April 19, 2012 at 10:00:47 PM
3
Kelvin Matheus 2,519 rep

Thank you for this help, now my game could be sounds. *-*

Friday, May 04, 2012 at 7:18:48 PM
2
Nickydude 11.3k rep

Another awesome tutorial.

Sunday, May 06, 2012 at 11:47:23 PM
0
Velojet 21.3k rep

@Kelvin Matheus @Nickydude Thanks very much for your positive feedback, too! Always nice when someone takes the trouble to leave it.

Monday, May 07, 2012 at 10:34:51 AM
2
tianxxxchris 3,710 rep

is good and, I am nop speak eglish

Sunday, July 08, 2012 at 7:40:05 AM
1
samiam10100 2,232 rep

How do I get the sounds? How do I download them?

Friday, July 13, 2012 at 7:22:31 AM
1
Velojet 21.3k rep

@samiam10100
"We're taking our sound files from the free bundle download of music, sounds and sprites"
- check your download for them.

Friday, July 13, 2012 at 10:19:15 AM
1
samiam10100 2,232 rep

Is it in the latest release of Construct 2 (r99)?

Friday, July 13, 2012 at 7:45:08 PM
1
samiam10100 2,232 rep

I try to import music and sound effects, but nothing shows up in the "Construct 2" folder in "Program Files".

Friday, July 13, 2012 at 8:04:21 PM
1
Velojet 21.3k rep

@samiam10100
Check in your 'Program Files\Construct 2\Music' and '\Sound FX' folders.

Friday, July 13, 2012 at 8:23:50 PM
1
samiam10100 2,232 rep

The only folders I see are "examples", "exporters", "languages", "sp", and "tools". Did I download the wrong release or something? I'm so confused. I have the free version of Construct 2, do you have to buy one of the two licenses?

Friday, July 13, 2012 at 8:49:04 PM
3
Velojet 21.3k rep

@samiam10100
Well ... I knew there used to be a free bundle of sound and music files that you got with the free edition. What had happened to it? I did a lot of searching, and finally came across a mention of it in a topic - but it doesn't seem to be widely publicised. Anyway, here's the link:
http://www.scirra.com/freebundle.zip

Enjoy!

Saturday, July 14, 2012 at 3:11:19 AM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.