Hi all!
I'd like to reproduce a sound after click the actionbttn. I read that using the library shinyjs could work. But I don't know how to do it. Any recommendation? please.
I tried to follow what is mentioned in this post:
Hi! Nice to see that my previous answer somewhat helped :).
From the code you shared above it's not clear to me whether you have included useShinyjs() in your UI. or whether you have www/howler.js file in your app dir.
Have you tried running this example to test whether you can hear the coin sound?
This post was published by an Appsilon team member. Our company can help you get the most out of RShiny and Posit/RStudio products.
Yes, I tried your example and worked!
Nevertheless, now I'm using flexdashboard, i.e. I'm running the app through a .rmd markdown file. So there is not a ui, nor server variable.
Ok, there must be some issue with the relative path.
Have you tried with src:['tono.mp3'] (without the fwd slash)?
If this doesn't work, maybe you can also try adding the full (not relative) path of your file, like D:/path/to/your/file/tono.mp3 (this seems unlikely to work, but it's worth a try since it is really easy to test).
Last, if everything fails, one very lousy workaround would be to have your .mp3 file hosted somewhere (github?) and source it from there.
HTH
This post was published by an Appsilon team member. Our company can help you get the most out of RShiny and Posit/RStudio products.
@agus no
It works only using the complete link from internet.
But there is something else. When I open the app on the browser (microsoft edge), the sound doesn't play, but locally on R studio, does.