Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by fulvio

I noticed that if I define my sound files like below they end up looping in both Chrome and Firefox:

collect: new ig.Sound('media/sounds/powerup.*')

OR

collect: new ig.Sound('media/sounds/powerup.*', false)

I have OGG and MP3 files so I define my ig.Sound() like this (which is actually default settings):

ig.Sound.use = [ig.Sound.FORMAT.OGG, ig.Sound.FORMAT.MP3];
ig.Sound.channels = 4;
ig.Sound.enabled = true;

The documentation states that any of the three will work:

ig.Sound() - Constructor

I&039;m just wondering why I'm experiencing looping when using #.* as opposed to .ogg?

1 decade ago by dominic

This sounds very odd. In both cases (.ogg or .*), the file extension is completely ignored. The file that&039;s actually loaded is, as you already mentioned, determined by #ig.Sound.use and the browser's capabilities.

Do you have an example online anywhere?

1 decade ago by fulvio

I looked through my main game class and noticed that I was adding music like this:

ig.music.add(this.titleMusic, 'title');
ig.music.add(this.labMusic, 'laboratory');
ig.music.add(this.cutsceneMusic, 'cutscene');
ig.music.add(this.lavaMusic, 'lava');
//ig.music.play('title');

Note the commented ig.music.play('title');.

It turns out that the problem was that I didn&039;t actually have #ogg or mp3 versions of those music tracks and for some reason that ended up triggering the ogg sound file looping every time I would play a sound file.

Keep in mind that the sound files actually had their MP3 and OGG versions, it&039;s just that defining them by using either #.ogg, .mp3 or .* would cause the looping.

Perhaps there&039;s a bug with adding music tracks but not having the files exist and also not calling #ig.music.play();?

I hope this makes sense Dom, if it doesn't I'll elaborate a little bit more.
Page 1 of 1
« first « previous next › last »