Hi everyone,
Is someone uses music tracks with an intro and a loop?
I tried a system with 2 audio objects, one for the intro, one for the loop.
With ActionList in parallel at the beginning of each scene, I run the intro and then the loop, but not in a good way. I use the "pause game" action, I indicate precisely the number of seconds (equal to the intro), and then the loop starts. But strangely this is not very accurate.
Is it expected to have "Wait until finish" with "play sound" action, or is there a better method than the one I use?
thanks
Comments
Just so you're aware, if you Play or Fade In the new music, the old one will fade out, allowing for a crossfade effect to ease the transition.
It works in an approximate way (it was better in unity 4, my previous settings are still too "long" in unity 5)
The two tracks are created to be played without a fade in, but I will test with a crossfade effect,
Thank you Chris!
You could take the "play sound" action, and make something like a "play intro+music" action or "play sounds playlist" action using audiosource.PlayScheduled with the audioclips.length of your clips.
Remember to preload you clip (it needs time to buffering and stuff :P) and use AudioSettings.dspTime+nextclip.lenght for your scheduled starting time.
ref: http://docs.unity3d.com/ScriptReference/AudioSource.PlayScheduled.html
For now, I'll keep with my first solution.