I'm having an issue with a button test that I am doing. I want the buttons to be able to play individual sounds when pressed, then continue in a loop until the button is pressed again to stop it. I don't have the loop yet because I can't even get the buttons to play the sounds. I am still learning and have played with samples codes to create the following. Can anyone tell me how to add sound to the following buttons and if there are any errors in what I have put together? I want to use sounds from "
https://www.soundjay.com/button-sounds-1.html", but honestly don't know how to do it.
<html>
<head>
<meta name="viewport" content="width=device-width">
<script src='file:///android_asset/app.js'></script>
</head>
<style>
body { background-color: #ffffff; }
.hello
{
font-size: 80;
font-family: cursive;
width: 100%;
margin-top: 2em;
text-align: center;
color: #A310D3;
}
.styled {
border: 0;
line-height: 2.5;
padding: 60px 40px;
font-size: 1rem;
text-align: center;
color: #fff;
text-shadow: 1px 1px 1px #000;
border-radius: 50%;
background-color: rgba(220, 0, 0, 1);
background-image: linear-gradient(to top left,
rgba(0, 0, 0, .2),
rgba(0, 0, 0, .2) 30%,
rgba(0, 0, 0, 0));
box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .6),
inset -2px -2px 3px rgba(0, 0, 0, .6);
}
.styled:hover {
background-color: rgba(255, 0, 0, 1);
}
.styled:active {
box-shadow: inset -2px -2px 3px rgba(255, 255, 255, .6),
inset 2px 2px 3px rgba(0, 0, 0, .6);
}
</style>
<body onload="app.Start()">
<div class=hello> Test App </div>
<p align="center" ><button class="styled">First sound</button></p>
<p align="center"><button class="styled">Second sound</button></p>
<p align="center"><button class="styled">Third sound</button></p>
</body>
</html>