Bug on stopping the Audio?

Hi there,

posting here a little bug (i think) hope it’s helpful for the community and it gets fixed soon.

On opening the screen an audio comes an plays correctly
When i click a button to stop it and to go to another screen it doesn’t work, here are my relevant blocks:

thunkable_support

On the click of “Red”, the audio doesn’t stop, but it goes to the another screen and it sets the variable.

What i have already tried:

  • Collocate the set.variable and navigate.screen under the “Then do” section

This generates a different error, the audio stops but i need to click the button twice in order to proceed with the other 2 commands (set.variable and navigate.screen)

  • Reverse the order of the blocks, collocating at first set.variable and navigate.screen

This allows to go to the other screen but it won’t stop the audio

  • Tried to do a Function including set.variable and navigate.screen

As result, it doesn’t work either

Any help would be very much appreciated

Thank you very much!

What are you initially setting the variable BackgroundColour to? Just setting up blocks the same as what you have above, I am unable to replicate the issue with the sound not stopping upon clicking the button.

Audio can be a little tricky* in Thunkable.

One thing to change is to put the set variable and navigate to blocks inside the “then do” section of the call sound block. Because those function call blocks do not pause the code. So when you stack them on top of each other like you’ve done, the set variable block happens essentially at the same time as the call sound block and then the navigate block fires immediately after that. To force those two blocks to fire after the sound stops, put them in the “then do” section.

*See this list of bugs: Issues · thunkable/thunkable-issues · GitHub, especially this one.

The Background is a variable that is stored for being used in the next screen, the value is a common image from cloudinary.

Hopefully i answered to your question

Hi tatiang,

thank you for your kind reply.
As I mentioned i tried your solution but it didn’t work:

What i have already tried:

  • Collocate the set.variable and navigate.screen under the “Then do” section

This generates a different error, the audio stops but i need to click the button twice in order to proceed with the other 2 commands (set.variable and navigate.screen)

So i assume this is a known beahavior

@maurizio.polverini89 Can you post the URL of this project? I have tried creating one as identical as possible to yours but am not having this issue with the sound. Thank you!

Thank you very much indeed.

This is the URL of the shared project (without api keys)
https://x.thunkable.com/copy/a0fda89eca8d783d7ec824a5d4ee0265