Can I play sounds?
I don’t mean long ones, just little ones, like explosions or gunshots.
Telemix - the changing face of telecoms.
Can I play sounds?
I don’t mean long ones, just little ones, like explosions or gunshots.
Telemix - the changing face of telecoms.
Interesting idea! You can add HTML5 <audio>
tags anywhere you can add HTML.
Here’s an app that confronts the user with squeaky cat noises:
https://anvil.works/ide#clone:45VAT5CE5POJZQ4I=PFBAOEQ54UG5D3R5EVUMCGLW
Wow, that’s harsh
So i guess I just need to load them in advance then trigger them with some call_js() shenanigans?
Yeah, that’s probably the best way. I’m not that familiar with <audio>
tags but I think you can do something like
$('#mycatsound').play()
There’s also an autoplay
property, and a controls
property that renders a little player (although it doesn’t sound like you want them to have any visible aspects).
If you’re not familiar with calling JS from Anvil, have a look at the reference docs:
I shall have a play and see.
I regularly get writer’s block and have to divert my attention onto short projects with a clear conclusion just to get the juices flowing. Often they tend to be time wasting games
My latest will be “Zombiezee” - a Pythons Vs Zombies game set on the Zambezi river…
What with holidays and shows I’m afraid not.
I will make a concerted effort though …