Page 1 of 1

Is it Possible to Change Music During Gameplay?

Posted: Tue Jul 02, 2013 1:35 am
by fazzasx
Hi Everyone,

I wanted to ask if its possible to change the music during gameplay using either playsound or something?

Reason for asking is it would be cool to have some sort of danger music or scene or area specific music play to change the mood and feel as music and sound play a key role in the atmosphere of the game itself.

Let me know if anyone has achieved or tried this yet!

Thanks

Re: Is it Possible to Change Music During Gameplay?

Posted: Tue Jul 02, 2013 1:38 am
by msyblade
You could use playSound to do it with very large .Wav files, it would just be up to you when they are triggered. The bad news is you will have no manual way of stopping a playing sound, so you are going to have large gaps of silence or overlapping music, because you cannot determine precise timing of each player. And the file size of doing wav's that last several minutes makes it nearly prohibitive to do. sorry!

Re: Is it Possible to Change Music During Gameplay?

Posted: Tue Jul 02, 2013 1:44 am
by fazzasx
msyblade wrote:You could use playSound to do it with very large .Wav files, it would just be up to you when they are triggered. The bad news is you will have no manual way of stopping a playing sound, so you are going to have large gaps of silence or overlapping music, because you cannot determine precise timing of each player. And the file size of doing wav's that last several minutes makes it nearly prohibitive to do. sorry!

Thanks msyblade for the quick response on this one :D

I will experiment and see what the options are. But like you said wav's are large files and to cut in and out music might not be good, I guess what we need here is some sort of mix function that can use mp3 or something similar to allow a lineup or queue of music that you can mix in and out and link to reference points or to hidden pressure plates or Monsters etc.

Thanks :D

Re: Is it Possible to Change Music During Gameplay?

Posted: Tue Jul 02, 2013 3:59 am
by Komag
in-level sounds must all be wavs, no mp3s allowed except for the one you choose for the whole level as the ambient. If you want to set up timers to start non-repeating wav sounds that when patched together sound like background sounds (overlapping a little, fade-in on top of fade-out with good timing), you might be able to achieve something like you're talking about.

Re: Is it Possible to Change Music During Gameplay?

Posted: Tue Jul 02, 2013 10:56 pm
by fazzasx
Komag wrote:in-level sounds must all be wavs, no mp3s allowed except for the one you choose for the whole level as the ambient. If you want to set up timers to start non-repeating wav sounds that when patched together sound like background sounds (overlapping a little, fade-in on top of fade-out with good timing), you might be able to achieve something like you're talking about.
Thanks Komag I will look at this also.