You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Callers can add a AudioFileEndBehavior component to their entity to indicate to bevy-kira-components what it should do when audio ends. This allows callers to have some convenience around entity/audio cleanup without having to poll themselves.
I suggested on Discord that it could be a good idea to additionally fire an event when audio ends, and let callers handle it themselves. I'm currently using Bevy's RemovedComponents to watch for audio ending and then inserting a new AudioFileBundle onto my entity to make it play the next sound in my SFX sequence. Despite bugs such as #23, I think RemovedComponents is working fine for my use case and so I don't actually have a need for such an event right now.
Triggering an event could be a good future escape hatch for cases where bevy-kira-components is too opinionated about ways the user wants to handle audio ended, but I also realised that in the audio_control example it's relatively easy to check the playback state yourself and do what you want. Plus, you can handle any playback state, not just Stopped. So it's not entirely clear to me that we should trigger an event here and so I've created this issue as a way to track that the idea exists, but not that it should necessarily be done (and to be clear that means at some stage this issue could just be closed as wontfix).
I know that in Bevy 0.14 observers are going to be available and there's also a question of whether that feature is appropriate here. It also looks like RemovedComponents is planned to be replaced with observers.
The text was updated successfully, but these errors were encountered:
Summary
Callers can add a
AudioFileEndBehavior
component to their entity to indicate to bevy-kira-components what it should do when audio ends. This allows callers to have some convenience around entity/audio cleanup without having to poll themselves.I suggested on Discord that it could be a good idea to additionally fire an event when audio ends, and let callers handle it themselves. I'm currently using Bevy's
RemovedComponents
to watch for audio ending and then inserting a newAudioFileBundle
onto my entity to make it play the next sound in my SFX sequence. Despite bugs such as #23, I thinkRemovedComponents
is working fine for my use case and so I don't actually have a need for such an event right now.Triggering an event could be a good future escape hatch for cases where bevy-kira-components is too opinionated about ways the user wants to handle audio ended, but I also realised that in the audio_control example it's relatively easy to check the playback state yourself and do what you want. Plus, you can handle any playback state, not just
Stopped
. So it's not entirely clear to me that we should trigger an event here and so I've created this issue as a way to track that the idea exists, but not that it should necessarily be done (and to be clear that means at some stage this issue could just be closed as wontfix).I know that in Bevy 0.14 observers are going to be available and there's also a question of whether that feature is appropriate here. It also looks like
RemovedComponents
is planned to be replaced with observers.The text was updated successfully, but these errors were encountered: