After adding the new SpeechAPI we are not animating the buttons currently, they change state for a few ms and not accurately animate until the speech ends. It seems that Audio creates an event on "ended" which should be where we revert the status.
While doing this change, I have also changed the logic on how the spell what you hear works. Instead of calling the timeout at the beginning of useEffect, instead wait until the articleInfo is loaded and then fire a shorter timeout. Now, the button also correctly animates when playing a sound.
Added a way to set the animation of a button from the parent. This is to allow us to play the animation in SpellWhatYouHear since we play the sound without any user clicks
After adding the new SpeechAPI we are not animating the buttons currently, they change state for a few ms and not accurately animate until the speech ends. It seems that Audio creates an event on "ended" which should be where we revert the status.
While doing this change, I have also changed the logic on how the spell what you hear works. Instead of calling the timeout at the beginning of useEffect, instead wait until the articleInfo is loaded and then fire a shorter timeout. Now, the button also correctly animates when playing a sound.