How do I....

Posts 1–4 of 4 · Page 1 of 1
How do I....
I have a form completely written out for a calculator.
I want the program to play audio if the calculator gets a specific answer.
Does anyone know how I would do this?
you are actually saying that the answer play audio?
Well it's just write a conditional code that's when an input by the client user is === to what you desire -> Add an HTML AudioFile and activates it right away.
If you are using html and javascript you can put an audio in the html like:
Code:
<audio id="audiohitmarker" src="mp3 url" style="display:none;" type="audio/mpeg"></audio>
And then with a conditional as Trools4Gamers says you launch the audio with javascript:
Code:
if(number === 2){
document.getElementById("audiohitmarker").play();
document.getElementById("audiohitmarker").volume = 0.2;
}
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us