Audio/Music/Sound

All things HTML5 or text based engines, or really any web based engines.
Post Reply
foolmoron
Posts: 25
Joined: Wed Sep 11, 2013 3:34 pm

Audio/Music/Sound

Post by foolmoron »

Is there any integrated way of playing sounds and music in this engine? Maybe I'm blind but I could not find anything that handled it.
signature
foolmoron
Posts: 25
Joined: Wed Sep 11, 2013 3:34 pm

Re: Audio/Music/Sound

Post by foolmoron »

I'm assuming the best way to handle this is using an external library such as SoundJS to play audio?
signature
User avatar
coolbloke1324
Posts: 181
Joined: Mon Jan 23, 2012 5:20 pm

Re: Audio/Music/Sound

Post by coolbloke1324 »

foolmoron wrote:I'm assuming the best way to handle this is using an external library such as SoundJS to play audio?
Hey ya,

I've been pondering sound support for a while now. There are many libs already available including the one that GoldFire wrote for CasinoRPG called "Howler.js".

I'm considering the benefit vs the work since other libs are already available. What are your thoughts on a built-in one?
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: Audio/Music/Sound

Post by Xaleph »

If I may pitch in, there are some excellent (modulair) audio libraries available which can, if done right, be integrated quite easily. I`m not sure how you feel about sharing credit, but there are some excellent libraries out there. If you create a wrapper for a good one, it can feel integrated while you only implement an interface for an existing library.

Not the best out there, but quite a simple one is: http://buzz.jaysalvat.com/, I simply created a wrapper at the time but it worked quite well.
foolmoron
Posts: 25
Joined: Wed Sep 11, 2013 3:34 pm

Re: Audio/Music/Sound

Post by foolmoron »

I don't think there would be too great of a benefit to an integrated system. There are so many sound libraries that it might be best just to let the developer pick whichever one fits the needs of the game. And sound generally going to be completely separate from the scene graph, so I don't see what you would do with an integrated sound system anyways, beyond just a wrapper.

Although for beginners, if there was a recommended sound library with an example, that would be useful. I saw Buzz before and it looked great. Howler looks really awesome, too, especially the sound sprites. I might go with that.
signature
robaldred
Posts: 64
Joined: Tue Aug 27, 2013 5:54 pm

Re: Audio/Music/Sound

Post by robaldred »

Personally I'd invest time elsewhere in the engine Rob. I've been using createjs's soundjs fine with ige. There's really no need for another library, unless of course howler was integrated I suppose.

I've not used it howler though so cannot comment.

But I'm a fan of soundJS from the createJS suite by Grant Skinner
There's also Sound Manager 2

I've used both, much prefer the soundJS, I wrote a little wrapper class which I use in all my html games, its by no means perfect but it works fine with IGE.

SoundManager source (coffeescript)
https://gist.github.com/raldred/6982954

Use it by first getting the soundmanager instance in your ige client

Code: Select all

this.sound_manager = SoundManager.getInstance()
load a sound using either (supports fallback types seperated by | (pipe):

Code: Select all

ige.client.sound_manager.registerMusic("path/to/music.ogg|path/to/music.mp4","intro")
ige.client.sound_manager.registerMusic("path/to/level1.ogg|path/to/level1.mp4","level1")
ige.client.sound_manager.registerMusic("path/to/level2.ogg|path/to/level2.mp4","level2")
load fx with:

Code: Select all

ige.client.sound_manager.registerFX("path/to/explosion.ogg|path/to/explosion.mp4","explosion")
ige.client.sound_manager.registerFX("path/to/select.ogg|path/to/select.mp4","select")
Then play sfx use the following:

Code: Select all

ige.client.sound_manager.playFX("explosion")
To play music: (music will fade from the currently playing track)

Code: Select all

ige.client.sound_manager.playMusic("level1")
Post Reply

Return to “HTML5/Web Engines”