Thought I'd share yesterdays grief I had using a piece of music in a timeline track that contained a loop. Here's what the object and timeline looked like:
[TitleObject]
Graphic = TitleGraphic
Position = (90, 90, -0.2)
Alpha = 0.95
TrackList = TitleTrack
[TitleTrack]
0 = >Object.Create TitleCreditsObject # Object.SetOwner < ^
1 = Object.AddSound ^ ThemeMusic
4 = >Object.Create TitleTouchObject # Object.SetOwner < ^
8 = >Object.Create TitleRulesObject # Object.SetOwner < ^
12 = Object.Enable ^ True ; dummy command to pad time
Loop = True
In windows, everything sounded fine when I started the game. I wanted the music to only occur when the TitleObject existed.
All was sweet, then I tested on Android. After a few seconds, it sounded like there was another copy of the music playing at the same time but, was out of phase, and it got worse as it went along.
After pulling my hair out for a day checking event code, I finally looked at the TitleTrack and realised my mistake.
For every loop in my TitleTrack which runs for 12 seconds, the another copy of the music would start at second 1. Not what I intended.
Windows covered this up due to the speed of the machine keeping copies in phase at first, but it was very obvious on a lower powered android device.
The solution is to of course, not play the music in the track, but to attach the music to the object itself.
[TitleObject]
Graphic = TitleGraphic
Position = (90, 90, -0.2)
Alpha = 0.95
SoundList = ThemeMusic
[TitleTrackMobile]
0 = >Object.Create TitleCreditsObject # Object.SetOwner < ^
4 = >Object.Create TitleTouchObject # Object.SetOwner < ^
8 = >Object.Create TitleRulesObject # Object.SetOwner < ^
12 = Object.Enable ^ True ; dummy command to pad time
Loop = True
Problem solved and another good reason to check the simplest things first.
Comments
PS: Sorry for the off topic.