CatinaCupGames / Dissonance-Prototype

A prototype for an action RPG game named Dissonance
2 stars 0 forks source link

Add option to fade out and in sound #105

Closed ecp4224 closed 10 years ago

ecp4224 commented 10 years ago

There should be an option to fade in and out sounds/music

The API should be something like this:

Sound.fadeOut("music1"); //Start fading out music1
Sound.fadeIn("music1"); //Start fading in music1

An optional API is the ability to do the following:

Sound.crossfadeFrom("music1").to("music2");

What the above will do is fade out music1 and fade in music2 at the same time to create a cross fade effect. This can be done by having fadeFrom start fading out music1 and return an object that has a to method in it, where the to method will fade in the sound provided. The object returned SHOULD NOT be a Sound object, because then the following would be possible

Sound sound = Sound.play("music2");
sound.to("music1");

Which doesn't really make any sense...

Arrem commented 10 years ago

Can slowly decrease/increase volume with AL_GAIN to get this effect. Could we do something like

Sound.crossfade("fromSound", "toSound");

to avoid returning an object just so we can call a .to("sound");

ecp4224 commented 10 years ago

Ya sure, that's probably the easiest and most practical way to go about it.

ecp4224 commented 10 years ago

This issue has been moved to the Internship milestone.