rancex
New Member
Posts: 18
Posts: 18
|
Post by rancex on Oct 12, 2023 10:57:14 GMT
I am using the Dynamic Sound Group creator for creating Dynamic playlist, and so far it worked great if I only have one.
However, when I am instantiating a creator with a playlist with the same name as a previous one, the new one will do nothing to the current playlist, although it will still add another playlist if no playlist with the same name currently exists.
Is there a way to make the new creator add its contents to the same currently existing playlist?
FYI I am using the playlist to create a layered music system using the built-in playlist crossfade system, and the creator as a container for each "layered groups" if that makes sense. So I have "calm/panic" music layer for each instrument in creator prefab A and the same thing for B, only with different audio clips. The problem is if I want to change the song obviously this system doesn't work since the newly added creator do nothing. I tried removing the currently instanced creator with the auto-remove option turned on, and while this allows me to change the song since the playlist is reset, it results in abrupt song change since the previous song is removed(I want to add a fading effect).
If there is no good way to answer my question perhaps you can look at my problem and give me some pointers. Thanks in advance.
|
|
|
Post by DarkTonic Dev on Oct 12, 2023 13:25:57 GMT
No, for Sound Groups in DSGC, you can add to existing Buses, but you can't add songs to existing Playlists.
You can add a song if you want to code it though.
MasterAudio.AddSongToPlaylist("playlistName", MusicSetting);
I'm afraid we can't add this to DSGC because the opposite (removing a song from a Playlist) will cause all sorts of issues.
What if you had all the songs from A and B in one prefab (all with different names), and programmatically chose the correct one to play based on whether it's calm or panic?
|
|
rancex
New Member
Posts: 18
Posts: 18
|
Post by rancex on Oct 12, 2023 15:17:45 GMT
Yeah I could do something like that but that means I also have to code the song removal manually as opposed to the current auto-remove playlist when I destroy the creator object. Not exactly a deal breaker though.
Separating them seems to make more sense because we will have different stages that have different calm/panic songs combination, like a song group for enemy A, B, C that we can mix and match depending on which one is on this stage. So naturally if say there is no enemy A song group A is just wasted memory if we put them all in one prefab.
I can do some tricks with callback after fading but I just wanna know if MasterAudio has way to deal with this instead of blindly going through it.
|
|
|
Post by DarkTonic Dev on Oct 12, 2023 15:21:15 GMT
|
|
rancex
New Member
Posts: 18
Posts: 18
|
Post by rancex on Oct 12, 2023 16:24:30 GMT
I see so they aren't added to memory from addressable the moment the playlist is loaded, but when they are played if I don't preload? I suppose I can work with that then.
The multiple DSGC option makes for easier sorting though, so I think I will try to work around it somehow. Thanks anyway!
|
|
|
Post by DarkTonic Dev on Oct 12, 2023 16:27:58 GMT
Yes, they are only in memory while being played if you use any of those options.
I could see naming the songs "battle-drums-calm", "battle-drums-panic" and programmatically playing songs by generating the name logically.
No problem.
|
|
rancex
New Member
Posts: 18
Posts: 18
|
Post by rancex on Oct 16, 2023 7:29:24 GMT
Sorry for necroing but I just got back to work haha.
I sort of found a workaround for this by using your add song advice, but instead of adding songs I added a new playlist based of my DSGC and renamed the playlist with a specific ID for each creator, and attaching them to specific instanced controllers. Using this, I can do the fading effect because they have different controllers and since they are technically different playlists now new songs can be added normally.
I suppose the main benefit is obviously I get to keep using the multiple DSGC pattern, but I wonder if there might be a problem in doing it this way?
|
|
|
Post by DarkTonic Dev on Oct 16, 2023 13:13:38 GMT
LOL necroing after 4 days?
No, that seems like a good solution. Go with it!
|
|
rancex
New Member
Posts: 18
Posts: 18
|
Post by rancex on Oct 17, 2023 3:49:51 GMT
Haha a bit of hyperbole I guess Alright then I guess I will go with this. Thanks!
|
|
|
Post by DarkTonic Dev on Oct 17, 2023 3:59:03 GMT
No problem.
|
|