Page 1 of 1

Multiple audio tracks.

PostPosted: Sat Nov 23, 2013 1:19 am
by BloodRedDragon
I'm trying to have dynamic music by using multiple audio files playing at the same time to create the background music, but Game Editor simply can't carry out two lines of code at once with all the ways I've tried. So I can't get the files to synchronize with each other, therefore they are out of time.

I'm using the PlaySound script in the script editor with variables for each channel. I have two actors each playing one sound file on the Create Actor event.

Anyone have any ideas? Is there a way to load two audio files within the same line of code?
Help is appreciated more than ever, as this is for a university project.

Re: Multiple audio tracks.

PostPosted: Sat Nov 23, 2013 7:47 am
by skydereign
BloodRedDragon wrote:but Game Editor simply can't carry out two lines of code at once with all the ways I've tried.

You can technically (by using && to combine the two into one "line of code"), but even running one line of code is not the issue. You want two functions to be ran at the same time, and for them to complete at the same time, which gE can't do. If you are dealing with small sound files, the delay between the two PlaySound2 function calls should be negligible. But since you are loading music, there is no reliable way to sync the two sounds since the speed each sound loads will change slightly on different computers.

Re: Multiple audio tracks.

PostPosted: Sun Nov 24, 2013 1:53 am
by BloodRedDragon
Thanks a lot for the help. Yeah i guess this is true, I know a few books that tell me a lot about how i would get dynamic music to work, but it requires far too much to look into, and I only have two months. Glad i got it cleared up though.