Skip to content

Bug: Overlapping audio #28

Description

@devklick

Sometimes different sound effects can overlap. This typically happens with the CardDealt sound and either the RoundWon or RoundLost sound. The reason this happens is that the as soon as a card is dealt the sound CardDealt sound starts to play, and before it has finished playing, the new card has triggered either a win or loss, causing the sounds to overlap.

I would rather avoid these overlapping sounds if possible.

One approach to doing so would be to keep track of all sounds that the game has triggered, and have these automatically removed form the list when the sound finishes playing. When it comes to playing a new sound, we could check the list of playing audio, stop and remove anything currently in the list, then add the new one to the list and start it.

Another approach could be to delay the game from calculating the result. Currently, a card is dealt after a delay, in order to have a pause between cards being dealt. This also means than when the initial cards are dealt, there's a slight delay before the first card is dealt, which isnt ideal. Perhaps a more suitable approach would be to delay after a card is dealt. This may allow enough time for the CardDealt sound to finish playing before the resulting process kicks in and causes either the RoundWon or RoundLost sound from playing

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions