Bug 449971 - Long pause before playing sound after flipping card in memory activities
Summary: Long pause before playing sound after flipping card in memory activities
Status: RESOLVED FIXED
Alias: None
Product: gcompris
Classification: Applications
Component: general (show other bugs)
Version: git master
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Jazeix Johnny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-10 20:48 UTC by Karl Ove Hufthammer
Modified: 2022-02-11 13:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Ove Hufthammer 2022-02-10 20:48:00 UTC
SUMMARY
In the Memory activities (e.g., ‘Enumeration memory game’), when you flip a card, there is an annoying ~.5 second pause before the corresponding sound is played.

STEPS TO REPRODUCE
1. Go to Enumeration memory game.
2. Flip a card containing a number.

OBSERVED RESULT
The card is flipped. Then there is a .5 second pause, and the word ‘number’ is spoken.

EXPECTED RESULT
The number should be spoken immediately after the card is finished flipping. Or even better, a fraction of a second *before*, since you can clearly see card front before the card is finished flipping.

ADDITIONAL INFORMATION
I *think* I know the reason for this. In src/activities/memory/CardItem.qml, there is an ‘interval: 1500’ timer (line 61), which must finish before the audio is played. But flipping the card takes less time. However, AFAICS, the long 1500 delay is intentional, to allow the player to take a good look at the card before it is flipped again (if it was the second card you flipped). And I don’t know how to fix it so that there’s still a 1500 delay, but that the sound is played right when the card is finished flipping (or a split second before).
Comment 1 animtim 2022-02-11 13:19:13 UTC
Git commit d1828dde4eb8f8f6e30b659d9e3cdd3cb75fbde2 by Timothée Giet.
Committed on 11/02/2022 at 13:15.
Pushed by timotheegiet into branch 'master'.

memory, play card audio as soon as it's turned without delay

M  +8    -5    src/activities/memory/CardItem.qml

https://invent.kde.org/education/gcompris/commit/d1828dde4eb8f8f6e30b659d9e3cdd3cb75fbde2
Comment 2 animtim 2022-02-11 13:22:34 UTC
I've fixed it to play the card audio as soon as the rotation is finished.
I should probably not play earlier, as the card rotation takes 750ms, and there's the audio effect of the flipping card which takes around 500ms, so the current flow of audio feels good this way.
Comment 3 animtim 2022-02-11 13:24:01 UTC
s/I should/It should/