Add Background Music?

#1

How do you add background music to your game? One of my group members created a music file, but I’m confused where you put the music file and how do you start playing it, preferably forever at this point.

0 Likes

#2

Check here:

Specifically, if it’s music I recommend ogg vorbis due to file size. Might have to double check if there’s different types of formats within that format. For example playing .wav sound is picky on bitrate etc.

There’s a looping parameter as well, might solve your playing forever need.

2 Likes

#3

The Sound page is too complicated for me. I noticed the 2D Platformer Creation Kit tutorial has quite nice step by step instructions: Add Game Object (to your collection), add Sound component for that object, assign a music file for the Sound component from the Properties panel and choose Play On Awake. And that’s pretty much it.

1 Like

#5

I’ve updated the sound manual to cover the absolute basics first, adding a sound component and causing it to play its sound. Check it out: https://www.defold.com/manuals/sound/

7 Likes

#6

Nice. I guess there are also sound related tutorials, but I have not been researching that far.

0 Likes

#7

Sounds simple enough but can’t find any tut, can anyone please help. I found the audio button, but where do I add the music?

I’m using BB2

1 Like

#8

The sound manual explains it all in detail:

Playing a sound/piece of music:

What is that?

1 Like