🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

OpenAL - Mergeing songs

Started by
0 comments, last by Puzzler183 19 years, 11 months ago
Hi everbody, I was writing a sound engine for a game and decided with a bit of work it could be completely re-useable it already has support for streaming, secordary streams with can be played instantly (i.e main menu -> loading) without having to load another part of the song from disk And then i was playing a game where the song merged into another song and i couldn't figure it out, it sounds really cool and would like to achieve the same effect in my games... Heres an example. Say theres a level of a game where the theme is really upbeat and bass-y but when the player jumps underwater the current song merges out and the new song has less bass and more 'flowing' sorta sound maybe slower, so i know there are two themes and an event causes them to merge until the new song can only be heard. Anybody know how this is done in OpenAL? (or if its possible?) i have a few ideas if anybody knows could explain it to me please. 1) Stream both songs at the same time one with 0 gain (silence) and one with 1 gain, after the event trigger gradually increase the new songs gain until it reaches 1 and gradually reduce the previous songs gain until it reaches 0. 2) Stream only one song at any time, and after the event trigger find out the current place in the song load the secondary song at that point merge like above and resume playing the new song until another trigger (sorry if the questions badly worded, hope you understand)
Advertisement
The whole interpolate the volume is the right idea. Use some form of smooth interpolation of the volume of the two songs such as cosine interpolation to get optimal results.

This topic is closed to new replies.

Advertisement