Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: selmiak on Sat 02/02/2013 01:54:12

Title: music out of sync
Post by: selmiak on Sat 02/02/2013 01:54:12
thanks to khris I'm using this nifty crossfader code (http://www.adventuregamestudio.co.uk/forums/index.php?topic=47261.0) and it works really good. But, yeah, here comes the but, but butt when I'm starting 3 tracks at once with
channel 1 = aTrack1.Play(eAudioPriorityNormal, eRepeat);
and so on the first 2 tracks in the script are in sync thus started at the same time but track 3 is out of sync. Only by a bit, but(t) the 3 tracks are all recorded in sync to be faded all around like a pink floyd record so yeah, it is hearable. Is hearable even a word? I have the bad feeling the answer is the audio system in AGS but maybe there is a way to start them all on the very same milisecond. They are just 3 lines in the script but one channel/track seems to take some cycles longer to start.
Title: Re: music out of sync
Post by: Khris on Sat 02/02/2013 19:43:06
Try this:
Code (ags) Select
  AudioChannel *channel1 = aTrack1.Play(eAudioPriorityNormal, eRepeat);
  AudioChannel *channel2 = aTrack2.Play(eAudioPriorityNormal, eRepeat);
  Wait(10);
  AudioChannel *channel3 = aTrack3.Play(eAudioPriorityNormal, eRepeat);
  channel3.Seek(250);   // <- play with this number to sync them perfectly