Hi..
Here is a class that will help you managing sounds on your game. It gives you an easy way to mute/unmute your BGM, SFX, or both. No need to check mute/unmute state manually anymore, this class will do that for you.
This class also ensure the currently BGM doesn't replayed accidentally. Say, you have 3 scene. In scene1 you play bgm1. Then the scene changes to scene2. In scene2 you call the code to play bgm1. Normally, bgm1 will replayed. This class will automatically prevent that. Sorry for my bad explanation. Just try it yourself
available at
https://github.com/zaniar/gideros_audioalso
(will be) available at
https://github.com/gideros/gideros-community-libs
Comments
Thanks i will surelly experiment it.
I just realize that "zaniar" is my (very) old github username. So I change my github username from "ezaniar" to "zaniar" for consistency reason. Please change your local repository to point to https://github.com/zaniar/gideros_audio instead of https://github.com/ezaniar/gideros_audio
* The first post of this discussion has been corrected
But please update your "simple example" in the description.
audio.setBgms{
["mainmenu"] = "path/to/mainmenu.mp3",
["gameplay"] = "path/to/gameplay.mp3"
}
audio.setSfx{
["explosion"] = "path/to/explosion.mp3",
["ding"] = "path/to/ding.mp3"
}
It's "setSfxs", not "setSfx" and "audio:setBgms" & "audio:setSfx" instead of "audio.setBgms" & "audio.setSfx".
It was a little confusing when trying your lib with the wrong example code, especially for beginners ;-)
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!