i want to do a volume fade for my bgm when start and end a scene… however, there is no implementation for volume change on SimpleAudioEngine, so i need to switch to AudioEngine, but i could not find documentation how to use it, i was seeing API the only function i check to play sound is play2d, i tried to play my music and indeed works (i haven’t played with volume things yet) the problem is that seems i can´t to play two diferents audio at same time because i try i get this:
Well, regarding to my question, i solved it changing from wav to mp3 (wav was recognized by SimpleAudioEngine, and mp3 by AudioEngine)… so the main thread point is solved!..
So, as i´m using AudioEngine rather than SimpleAudioEngine, the volume is solved too…
Just was a bit curious about how it works thats why i was looking for docs…
Now i checked for another way to acchieve this fade, i was looking the MathUtil::lerp() function that could modify the float volume value, but does it needs to be executed inside some kind of update function?
that is good…
only need to fade at scene start and end…
i will give a try to use update() about a very little portion of time at begin and end of the scene… it is just to avoid abrupt music stop…