|
Post by noenoenoe on Aug 18, 2020 9:37:33 GMT
Playing a playlist containing 1 song with <Loop Playlists> option causes infinite replay on crossfading section.
My reproduce steps are below:
1. Make a playlist [TestPlaylist] with:
- Crossfade Mode: <Use Master Setting>
- Fade In First Song: false
- Fade Out Last Song: false
- Bulk Song Changes: false
- Song Transition Type: <New Clip From Beginning>
- Clip Create Mode: <Clip>
2. Add a song [TestSong1] to playlist [TestPlaylist] with:
- Loop Clip: false
- Song Start Time Mode: <Beginning>
3. Set Playlist Controller:
- Shuffle Mode: true or false
- Loop Playlists: true
- Auto advance clips: true
When I play [TestPlaylist], I want to play [TestSong1]→[TestSong1]→[TestSong1]→(repeats infinitely),
but it results [TestSong1]→Crossfading [TestSong1]'s first n-seconds→Crossfading [TestSong1]'s first n-seconds→(repeats self-crossfading section infinitely).
If [TestPlaylist] has 2 or more songs, this problem doesn't occur. (with crossfading between songs, naturally)
If [TestPlaylist]'s Crossfade Mode is <Override> and has value of 0 second, there's no self-crossfading section, and this problem doesn't occur. But it doesn't crossfade with other playlists also. This is not I want.
Waiting for your advice.
Thanks in advance.
|
|
|
Post by DarkTonic Dev on Aug 18, 2020 15:46:05 GMT
I'm not sure if I hear the same thing. If I set Master Crossfade Time to 1 second then I repeatedly hear the last 1 second fading out as the first 1 seconds plays again, and the rest of the song does play until it gets to the crossfade part. If I watch the Jukebox for that Playlist it is working properly.
None of this is a bug.
It sounds like you just don't want any crossfading to occur if you have a single song in the Playlist. Is that correct?
|
|
|
Post by noenoenoe on Aug 19, 2020 3:28:18 GMT
I've tried some more tests with other audio clips and, you're right, Playlist Controller is working properly, and found that this problem occurs on some specified audio clips. Maybe it depends on audio file format, frequency, bit-rate, or so. Do you have any clue or report of the case like this...? (I'll trace more about this too)
Thanks for reply.
|
|
|
Post by DarkTonic Dev on Aug 19, 2020 5:06:28 GMT
No, I haven't heard this before. If you figure out what file formats or other import settings make it happen, let me know and I'll either fix it or put a note in the documentation letting people know.
Thanks, -Brian
|
|
|
Post by noenoenoe on Aug 26, 2020 6:30:29 GMT
I've made some tests in the meantime, and it seems that the problem occurs when I set Unity's 'Preload Audio Data' property to FALSE at audio clip's Import Settings. When I set the property to TRUE at same audio clip, this problem was disappeared.
Is there anything that could be a problem...? Expecting your advice again. Thanks in advance.
|
|
|
Post by DarkTonic Dev on Aug 26, 2020 15:57:04 GMT
Yes, that does cause the error. I have fixed it for the next update. If you need the details to fix it on your end, I can provide line numbers.
|
|
|
Post by noenoenoe on Aug 28, 2020 9:56:14 GMT
Thanks a lot. Can I see line numbers of that?
|
|
|
Post by DarkTonic Dev on Aug 28, 2020 15:41:24 GMT
Line 1894 in PlaylistController.cs, you need to surround the Unload method call with this new if statement:
if (_transClip == null || _transClip.clip != source.clip) // don't unload audio if the same song is playing for crossfade { AudioUtil.UnloadNonPreloadedAudioData(source.clip, GameObj); }
|
|