fix(sound): boarding complete and welcome onboard announcements playing simultaneously#10598
fix(sound): boarding complete and welcome onboard announcements playing simultaneously#10598Ditoo29 wants to merge 2 commits intoflybywiresim:masterfrom
Conversation
|
Hey @Benjozork just bumping this in case it got forgotten. Thanks :D |
|
@BravoMike99 sorry to ping you here, not sure what other developers do code reviews. Hopefully this isn't forgotten. |
Maximilian-Reuter
left a comment
There was a problem hiding this comment.
In general I feel like the logic of playing the welcome aboard should be all contained in BoardingSounds as it doesnt depend on any external factors but elapsed time from the boarding completed sound.
Not sure personally about the best way to deal with that as currently BoardingSounds doesnt have a concept of delta time. @Gurgel100 do you have ideas ?
| self.pax_boarding = false; | ||
| self.pax_deboarding = false; | ||
| self.pax_complete = false; | ||
| } |
There was a problem hiding this comment.
in my opinion, there needs to be another entry here for pax_welcome so it is also properly stopped when the other ones are.
There was a problem hiding this comment.
The pax_ambience isn't set to false here as well. As for how I have the logic for this welcome sound to play not sure if setting this to false here would break anything. Will dig deeper.
…simultaneously (flybywiresim#10549) - Split welcomeonboard onto separate SOUND_WELCOME_ONBOARD local variable - Add delay timer in BoardingSounds to trigger welcome announcement after boarding complete
4b0a283 to
a1a95f0
Compare
| pub fn update_welcome(&mut self, delta: Duration) { | ||
| if self.welcome_timer > Duration::ZERO && !self.pax_welcome { | ||
| self.welcome_timer += delta; | ||
| if self.welcome_timer >= Self::BOARDING_COMPLETE_WELCOME_DELAY { | ||
| self.pax_welcome = true; | ||
| self.welcome_timer = Duration::ZERO; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
What about using DelayedTrueLogicGate which essentially implements exactly this logic?
There was a problem hiding this comment.
See this is why I wanted a Rust expert to look at this! What are the best ways to get an UpdateContext to BoardingSounds ?
There was a problem hiding this comment.
Since this function is ultimately called in the update function one could pass the UpdateContext there.
Fixes #10549
Summary of Changes
Split the
welcomeonboardandboardingcompletedannouncements onto separate local variables (A32NX_SOUND_BOARDING_COMPLETEandA32NX_SOUND_WELCOME_ONBOARD) so they no longer trigger simultaneously. Added a delay timer inBoardingSoundsthat starts when boarding completes and fires the welcome announcement after 10 seconds, ensuring a natural gap between the two announcements. Works for both standard boarding and GSX boarding.Screenshots (if necessary)
N/A - audio only change
References
Issue #10549 - reported that after sound system adjustments, boarding complete and welcome announcements play back to back with no gap.
Additional context
The fix is contained entirely in
BoardingSounds,PayloadManagerand the corresponding XML sound definition.Discord username (if different from GitHub): dito29
Testing instructions
boardingcompletedannouncement playswelcomeonboardannouncement plays ~10 seconds later