sugarizer icon indicating copy to clipboard operation
sugarizer copied to clipboard

Card Sound Plays Only After Language Selection

Open AliHassan245 opened this issue 10 months ago • 12 comments

  • Issue: Clicking a card's image doesn't play its sound unless a language has been selected.

  • Expected Behaviour: The sound should play immediately upon clicking the card image, regardless of language selection.

https://github.com/user-attachments/assets/9a04b4ae-666c-47e0-90b0-030ba0e0140c

AliHassan245 avatar Feb 14 '25 11:02 AliHassan245

@llaske Sir, may I proceed with this issue?

AliHassan245 avatar Feb 14 '25 14:02 AliHassan245

Look like a loading issue. Hard to reproduce: I guess you should click as soon as possible on game selection to have this behavior.

llaske avatar Feb 15 '25 09:02 llaske

@llaske Sir let me try if possible

AliHassan245 avatar Feb 15 '25 15:02 AliHassan245

Hi @AliHassan245 i tried to reproduce the issue but i found no issue with the activity. Everything seems to be working fine.

https://github.com/user-attachments/assets/301fa677-e88f-4bf6-8ff7-e11c738dad98

AdityaKrSingh26 avatar Feb 15 '25 15:02 AdityaKrSingh26

@AdityaKrSingh26 there is a bug in intial behaviour of foodchain activity when cards are loaded.

AliHassan245 avatar Feb 15 '25 19:02 AliHassan245

@llaske Sir, this issue is very simple: the English cards load by default, but the sound files aren’t initialized until a language is selected. I'll fix this by setting the English sound files by default so they play on card click.

I have resolved the issue on my local device. Let me know if I can send a PR.

https://github.com/user-attachments/assets/dd80902b-7017-42e7-be54-346bf60c12b5

AliHassan245 avatar Feb 15 '25 19:02 AliHassan245

@AliHassan245 I can't reproduce the issue on my side, like @AdityaKrSingh26 even when I force a low speed network.

llaske avatar Feb 15 '25 20:02 llaske

@llaske Sir, I’ve double-checked with my friends, and they are also experiencing this issue. To help reproduce it, please follow the steps shown in the video:

https://github.com/user-attachments/assets/329d11df-302d-467a-9c08-f8597b31abb5

Issue Explanation: When the activity is opened for the first time, the cards default to English, but the sound files are not initialized until a language is selected. However, since the cards are already in English by default, the sound files should also be initialized to English automatically, but they aren’t.

To further confirm the issue, here’s another video from a friend experiencing the same behavior:

https://github.com/user-attachments/assets/4b295356-38df-4112-92da-feb3420cdd39

To resolve this, I’ve ensured that the sound files are initialized to English by default, aligning them with the default English cards.

https://github.com/user-attachments/assets/86b860be-5597-4c64-8380-831952af8288

AliHassan245 avatar Feb 16 '25 10:02 AliHassan245

Ya I can also reproduce the issue on my end

SnehalSrivastava27 avatar Feb 16 '25 13:02 SnehalSrivastava27

Can't reproduce. Are you sure you're on the latest dev branch?

https://github.com/user-attachments/assets/d71d813e-fc51-43fc-b6ba-7fec6429fd8f

llaske avatar Feb 16 '25 22:02 llaske

  • @llaske Yes Sir I'm on the latest dev branch and can confirm that the issue still exists. It's inconsistent across devices, which is puzzling, yet the problem is undeniably real and should not be overlooked.

  • On my side, I've updated the code by adding a fallback mechanism that ensures if no language is selected, the activity defaults the sound files to English—just like the cards, which already default to English. This change consistently eliminates the sound initialization issue on all affected devices. Let me know if I can share this with you in a PR.

AliHassan245 avatar Feb 17 '25 02:02 AliHassan245

@AliHassan245 post your PR, I will have a look on it.

llaske avatar Feb 17 '25 21:02 llaske