racines
New Member
Posts: 7
Posts: 7
|
Post by racines on Jan 28, 2021 16:22:50 GMT
No need to create a package to reproduce this, I made this simple script: drive.google.com/file/d/1xV-ycvhv605MwlpwJTVqef66niTaLrAY/view?usp=sharing1) Add the script in a scene where there is a playlist using crossfade 2) Start the scene and press "space" few seconds before the begin of the crossfade. => you will see that crossfade is ignored (in my test crossfade duration is 3 seconds) By default the script will simulate 1 FPS for 20 seconds, so you will have difficulties to interact with editor during this period. Maybe you can have a look to Time.maximumDeltaTime to see if it can help. (On my side, it's not changing anything when I set it to 1.5 seconds)
|
|
|
Post by DarkTonic Dev on Jan 28, 2021 20:54:37 GMT
Ok thanks, I'll take a look when I can.
|
|
|
Post by DarkTonic Dev on Jan 29, 2021 0:53:02 GMT
I tried it with zero crossfading and your script and the gapless song transitions and it seems to work properly. Do you have to have crossfading or something?
When I tried it with 3 seconds crossfading it does play the next song. What exactly are you seeing or hearing when you do that? To me it looks like the first song may stop, and then it plays the 2nd song and starts crossfading it at the same time, instead of the last 3 seconds of the previous song. Is that what you see?
|
|
racines
New Member
Posts: 7
Posts: 7
|
Post by racines on Jan 29, 2021 12:10:25 GMT
My use case is: I have a playlist that loop the same song with a crossfade transition to simulate an endless music. At 1FPS the crossfade is not working as intended, causing a brutal transition when looping the music. (the next song is always played)
After a new test to check what you say, I am experiencing the same result as you: The first song stops brutally, then the second starts crossfading (at 1FPS). It plays the 1st song until the end instead of starting the crossfade 3 seconds earlier. I think even at 1 FPS this should not happen.
It would be perfect that when MA detect the crossfade it starts the crossfade depending of the difference with the normal start: for exemple if you detect 0.589 seconds later that the crossfade should have been started, you could start the next song at 0.589 seconds instead of from the beginning? This will keep the 2 tracks in sync.
|
|
|
Post by DarkTonic Dev on Jan 29, 2021 23:20:26 GMT
So I did some more testing. Regardless of anything else, our code is only going to run 1 time a second, at least if your script works the same as the browser throtting.
IEnumerator SimulateOneFPSCoroutine(float duration) { Application.targetFrameRate = 1;
yield return new WaitForSecondsRealtime(duration);
// use default behavior for framerate Application.targetFrameRate = -1; }
So that will mean that even if I were to make this "work", a 3 second crossfade would be reduced to 3 huge volume "chunks", 1 per second. It will sound like a really terrible crossfade and won't be smooth. I'd think you'd rather avoid that and just use gapless transitions with no fade? I confirmed this through logs. Volume is full. 1 second later it's 0.66 (CHUNK). 1 second later it's 0.33 (CHUNK). 1 second later it's 0 (CHUNK).
|
|
racines
New Member
Posts: 7
Posts: 7
|
Post by racines on Feb 1, 2021 15:18:51 GMT
In my case the gapless settings do not fit my needs, because it means I should modify all the music assets of my game to have the end corresponding to the begin of my music. I already done all these adjustement a while ago and don't want to make it again. So even if the crossfade is not perfect at 1FPS it will be better for me to keep my musics synchronized when looped. Or maybe if you have a way to also set a end music time (like the start settings) in the settings of a clip I could have a good result. But it's also more work to find the right delay...
|
|
|
Post by DarkTonic Dev on Feb 1, 2021 21:42:07 GMT
Ok I will see if I can make it work with the chunking volume. It may take awhile.
|
|
racines
New Member
Posts: 7
Posts: 7
|
Post by racines on Feb 2, 2021 17:00:38 GMT
Thank you!
|
|
|
Post by DarkTonic Dev on Feb 2, 2021 17:06:05 GMT
I will report back when I have some news.
|
|
|
Post by DarkTonic Dev on Feb 28, 2021 1:56:44 GMT
I was working on a particular hairy issue that's ahead of yours which is almost fixed I believe. I will get to your issue eventually. I know it's been awhile.
-B
|
|
|
Post by DarkTonic Dev on Mar 21, 2021 1:25:33 GMT
Ok I found the code that detects to start the crossfade and fixed it to work with 1 FPS. I would like you to test it before I release, so please PM me asking for the fix.
Sorry for the long wait. It's been crazy.
-Brian
|
|