Sound when function executed

I want a website to make an audible sound and maybe repeat 5x when a function is called.

Function makeSound() {}
makeSound();

When function is called a sound is made in a browser based application.

Any suggestions how to do this? A beep or ringing is fine.
Thanks!
Karen

I think this Topic should be posted in the JavaScript Forum because PHP functions are processed serverside and their results converted to HTML script before being sent to the browser.

JavaScript sound functions can be dynamically called on web page content.

1 Like

Hi there karentutor1,

have a peep at this rather silly gonging example…

gong.zip (58.2 KB)

Edit:

uploaded the wrong file which was ten times larger. :eek:

coothead

1 Like

Which file should I use?

Hi there karentutor1,

you should use the gong.zip(58.2KB) file. :winky:

Due to an oversight, on my part, the original
file which I uploaded weighed in at 572KB. :wonky:

coothead

Hi
Thanks - this is an ‘onclick’ sound. i.e. a user generated event.

Rather, I am looking for the sound to be made when a function is called by the server
(sorry delay had trouble getting my laptop to make sound…)

Is it possible to build it using a php function call?