gavi
New Member
Posts: 12
Posts: 12
|
Post by gavi on May 18, 2020 17:05:09 GMT
Hello, maybe I do not understand the intention of the event, but when I do:
currentSong = MasterAudio.PlaySound3DFollowTransform( songId, transform); if (currentSong != null && currentSong.SoundPlayed)
{
currentSong.ActingVariation.SoundFinished += OnCurrentSongFinished; etc.
What happens is that OnCurrentSongFinished is called even when the sound is interrupted by another song in the limited bus, and even when I explicitly call:
if (currentSong?.ActingVariation !=null)
currentSong.ActingVariation.Stop();
If it is the intention that SoundFinished event must be called also when a sound is stopped or interrupted for any reasons, can one subscribe to another event which specifies whether the sound completed or was interrupted ? ( passing a bool, or maybe having also a different event such as currentSong.ActingVariation.SoundCompletedUninterrupted += )
|
|
|
Post by DarkTonic Dev on May 18, 2020 18:01:40 GMT
Are you really playing music through a Sound Group? Why?
Anyway, yes all those scenarios will call SoundFinished. There is no other event. It simply means the Audio Source stopped. Master Audio doesn't know the difference at the moment.
|
|
gavi
New Member
Posts: 12
Posts: 12
|
Post by gavi on May 18, 2020 19:53:27 GMT
Are you really playing music through a Sound Group? Why? Anyway, yes all those scenarios will call SoundFinished. There is no other event. It simply means the Audio Source stopped. Master Audio doesn't know the difference at the moment. Thank you for asking. Maybe I do not understand how MA works because it is the first time I try to use it in a project. I am making an app for a VR Android device: it is very limited in resources, so I was attracted to MA by the loading, unloading, completion-event and delayed-sound-start features. I see many other features that are very useful in games in general, so I wanted to learn MA in any case. I was hoping that MA would give me helpers for my current use case, but the more I use MA,the more I feel that it is great, and I will certainly use it in my future apps, but maybe it more a complication than a help for the specific app I am doing now. The delayed-sound-start did not work, so I wrote my little coroutine for that. The soundFinished event does not provide info about the cause of the sound end, so I will write my little event for that. With loading, I still have got to load in advance from addressable to make sure that the sound will play exactly when I ask for it to play, because the play-sound-with-delay, even if it did work, seemed to start loading from addressable at the last moment and not at the advance time when I request MA for a sound to play in the future. The playlist: I am using just one playlist for the one song background music, just to learn the API and see how it sounds in VR (it sounds very well). In my app I have got approx a hundred songs to play in "game playlists", but I play the songs with the soundAPI because my use case is that I play each song one at the time, and sometimes I have got to interrupt the song. I do not play songs one after the other, but there is a pause of a couple of seconds between songs. Also I need to sync the start of the song very precisely because I move some objects at the player in advance and such objects need to arrive in sync with the music's features, and such objects take a couple of seconds to travel to towards the player, hence the delayed start of each song. Furthermore, even though I have got many "game playlists" (combining the songs in many different ways), some "game playlists" are dynamic, so I would have to create the MA-playlists programmatically in MA, not at design time. Having each song in MA as a sound, rather than belonging to many MA-playlists, allows me to keep the number of game-object children of MA about 6 or 7 times smaller (it helps in having a faster game start, I think). Thank you for asking. The sound of my voice is lost in writing so I clarify that: I am not complaining: MA is great for games in general, I am just explaining my specific use case of this specific project I am doing now.
|
|
|
Post by DarkTonic Dev on May 18, 2020 20:19:50 GMT
The delay issue is not an issue as I understand it. The delay works, you just don't have a "trigger" to hook on to precisely when it starts.
Playlists don't even use additional game object children at all - they are all contained in the Master Audio game object itself. If you put songs in Sound Groups they do need children.
Creating either a Playlist or a Sound Group at runtime isn't really supported, so I'm not sure what that saves you. And I don't see how it would affect load time at all.
Anyway, if you would like to request 1 or 2 things that I can add to the roadmap that you think are useful, I can do that and get to them eventually. Sometimes quick, but it depends how difficult it is. Be very specific please.
-Brian
|
|