How to add music to a game?

Get help using Construct 2

Post » Sat Mar 10, 2012 4:03 pm

Hey guys,

I imported my favorite music track, added the audio object, and tried to play the track. But on the parameters window of the Play action, it tells me that there are no sounds imported (even though I can see the music under Music folder in Project view).

If I import a sound to the Sounds folder, the sound will show up and I can play it, but the music still doesn't show up.

What am I doing wrong?

Thanks.
B
14
S
5
G
7
Posts: 233
Reputation: 5,156

Post » Sat Mar 10, 2012 4:09 pm

OK looks like I got it to work, and found a bug in the process

If I import the m4a, it doesn't show in the parameters window. If I import the ogg, it does show.

If it was meant to be like this, then it shouldn't allow importing of m4a.

Mods, Please move this thread to bugs, thanks.
B
14
S
5
G
7
Posts: 233
Reputation: 5,156

Post » Sat Mar 10, 2012 5:20 pm

I have imported many sounds to my game, and in my case the only thing that causes this problem u encountered.
Is that i needed to setup the correct format within a sound editor.
Wav
44.1 hrz
16 bit

Now i have downloaded samples from the internet that did have these specs.
But when they did not work in construct 2 i only needed to open them in my sound editor, and then re-export the wav to 44.1 hrz & 16 bits.
My gues is that not all wav "sound" files are build correctly.
So in my case its not really a construct2 problem.
Its just faulty music files.
Resampling works everytime and the m4a does work as it is a fundamental extension for some browsers.

Savvy0012012-03-10 17:23:08
B
37
S
14
G
4
Posts: 563
Reputation: 7,533

Post » Sat Mar 10, 2012 7:53 pm

Could be, but I was importing from the music that comes bundled with Construct 2, so if the file format was wrong, it's still C2 issue (not a code issue, but still a C2 issue ).

I will keep this in mind though in case I get this in the future.

On a second thought, the import succeeded for me, so regardless of the file format, I should have seen it in the Play parameters. Or if not, then I should have gotten an error importing. So there still is a bug somewhere.

I can post capx and proper repro steps if it's not clear what the problem is.

Cheers!
B
14
S
5
G
7
Posts: 233
Reputation: 5,156

Post » Sat Mar 10, 2012 9:34 pm

m4a files are required for internet explorer only, whereas ogg files will work in chrome and FF ("only").
When importing music, you need to have both the m4a AND ogg files (or import from wav or other supported sound format, in win7, ogg and m4a will be created by C2).

It's not as much a bug as a "requisite".
Having only a single sound file format is bad design due to the way the audio plugin works for now (due to the audio support in browsers).
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
200
S
68
G
32
Posts: 6,087
Reputation: 47,960

Post » Sun Mar 11, 2012 5:38 pm

True it doesn't work on Internet Explorer. So how exactly do you play the same music on all browsers? The imported m4a doesn't show up in the list of the action parameters when I add the Play action.

Would really appreciate a "for dummies" step by step on making the same music play on all browsers (I do have both the ogg and m4a files).

Thanks!
B
14
S
5
G
7
Posts: 233
Reputation: 5,156

Post » Mon Mar 12, 2012 3:04 pm

Thanks @Kyatric, that is correct, could you explain step by step how to add music (from the bundled music for example, but not necessary) such that it plays on all major browsers?

I can't seem to get I.E. to work.

Thanks.
B
14
S
5
G
7
Posts: 233
Reputation: 5,156

Post » Mon Mar 12, 2012 6:02 pm

Each files are in ma4 AND ogg format.
Let's say you want to have the music "MattOglseby - 1", you import "MattOglseby - 1.m4a" and "MattOglseby - 1.ogg".
When you set the play action, it will pick the format according to the user's browser.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
200
S
68
G
32
Posts: 6,087
Reputation: 47,960

Post » Mon Mar 12, 2012 6:20 pm

OK that worked. I actually tried this, importing files one by one - I already had the ogg imported, when I added the m4a, and it didn't work (this must be some bug of sorts but anyway) - and the m4a got renamed.

If I import them ogg and m4a at the same time, it works.

Thanks @Kyatric.
B
14
S
5
G
7
Posts: 233
Reputation: 5,156

Post » Sun Apr 07, 2013 10:52 pm

I have what seems to be a similar problem...
I'm simply trying to IMPORT an audio file into the Sounds folder. I just moved the sounds I'm trying to import into the right folders on my computer (for organization purposes). But, C2 says the files aren't even there when I go to import them.

I'm trying to import mp3 files. Is that my issue or is it something else?
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
==============================
From 6 coin-op classics, 1 console hyper-shooter, and C2...
...comes one intense action shoot-'em-up...
=== GRADIENT RUN ===
Prepare for a hyper-fest of action!
Inspired by...
- ASTEROIDS - GALAGA - PACMAN - XEVIOUS - R-TYPE - GRADIUS - GEOMETRY WARS
gradient-run-fast-paced-shooter-coin-op-7-game-mash-up_t127056
B
74
S
13
G
5
Posts: 663
Reputation: 10,129

Next

Return to How do I....?

Who is online

Users browsing this forum: DUTOIT, Lordshiva1948, necromaster, oirad, rekjl and 4 guests