One problem is that you can&
039;t change volume or anything while it's looping. In order to add volume control, I allow players to change #ig.soundManager.volume
and
ig.music.volume
.
However, with looping sounds, changing
ig.soundManager.volume
does nothing to the already-playing sound effect. The only way to mute it is to call the sound's stop method.
I&
039;m also having level change problems with looped sound effects. I usually call #ig.music.stop()
on level changes, but with looped sound effects this is tougher. If I'm switching levels with a call by anything but the entity that "owns" the sound effect, it can be tough to try to track down and stop the looped sound effect.
All this to say: I&
039;d love it if sounds would check in to see if the #soundManager
volume changed. Furthermore, I&
039;d like it if child sounds of entities had their #.stop()
method called when the entity is being removed.
By "child sound," I mean that if the code was like so:
EntitySampleEntity = ig.Entity.extend({
sampleSound: new ig.Sound('media/sample.*')
});
sampleSound
would be a "child sound" of
EntitySampleEntity
.
I realize that in order to implement either of these would probably be difficult and not worth it. The only way I could really see the second one working is if sounds registered themselves with
ig.soundManager
and you could then find them through a lookup. Anyway, that's my two cents if you want it.
I could also be missing something obvious that I should be doing, and if I am, please tell me!
TL;DR: Looped sounds are difficult to manage, and having a way to look up/manipulate them more easily (such as them checking
soundManager
for volume instead of having to manipulate them each individually, or being able to look them up to manipulate them rather than trying to find their parent entity) would be beneficial.