Audio/Music/Sound
Audio/Music/Sound
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
Re: Audio/Music/Sound
I'm assuming the best way to handle this is using an external library such as SoundJS to play audio?
signature
- coolbloke1324
- Posts: 181
- Joined: Mon Jan 23, 2012 5:20 pm
Re: Audio/Music/Sound
Hey ya,foolmoron wrote:I'm assuming the best way to handle this is using an external library such as SoundJS to play audio?
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?
Re: Audio/Music/Sound
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.
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.
Re: Audio/Music/Sound
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.
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
Re: Audio/Music/Sound
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
load a sound using either (supports fallback types seperated by | (pipe):
load fx with:
Then play sfx use the following:
To play music: (music will fade from the currently playing track)
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()
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")
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")
Code: Select all
ige.client.sound_manager.playFX("explosion")
Code: Select all
ige.client.sound_manager.playMusic("level1")