Play sound during animation
Solved
General and Desktop
-
Hello dear community,
I'm trying to play a sound with sound effect, but only when an animation runs.
My code is:
if(animationX.running) { mySound.play() }else if (!animationX.running) { mySound.stop() }
I can get this sound running when the animation starts, but when the animation stops the sound continues to play and doesn't stop.
Appreciate any help
Thanks in advance
-
Are we talking QtQuick ?
If so, see the Animation type finished documentation -
Hi,
Why not connect the animation finished signal on your sound stop slot ?
-
Are we talking QtQuick ?
If so, see the Animation type finished documentation