Hi, I am trying to play a random song within a playlist and I can get it to function but I can hear the previously started song fade out and the new song fade in. I'd like to be able to play a random song without hearing the previous song fade out.
Here is the code I am using to play a random song in a playlist:
public static void PlayRandomSongInPlaylist(string playlistName)
I guess the question is how to set or change the current playlist without starting it? Thanks for any help.
Got it thanks. I just have one other minor issue that would be awesome if you could help with. In my game I made a lot of playlists with individual songs because I was having issues with having lots of songs on one playlist. However, I have an issue where if I start a playlist with one song, then I restart the playlist, the music does not start again. For example, in my game when a cutscene starts, I call StopPlaylist(all), then ChangePlaylist(character_theme), then RandomPlaylistClip(), and the music starts and works fine. But when I re-enter the same cutscene the music stops but fails to start again. How can I restart the music? I tried a bunch of other methods but none of them seem to work. Maybe I'm missing some kind of setting to reset the clip?
I am using code. I'm using this other asset - Dialogue System for Unity. It has integration with Master Audio so I can call Master Audio functions in its sequencer.
Actually I just got it working. I had to explicitly set the Song Id and then call MAPlaylistClip(songid) and it works. I thought it was naming the clip the same name as the playlist automatically because that's what it looked like in the UI but apparently not.