/    Sign up×
Community /Pin to ProfileBookmark

Sound using javasript

I want to play sound using javascript .I just want that when user refresh page it produes sound like ‘tin’ .
Thanks

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@rootJun 06.2007 — Sound in website is may favourite pet hate, it not only is invasive but in a vast majority of cases unwanted intrusion to someoned audio output.

I could rattle on about how it cost me £180 to replace my speakers because the tweeter in one was blown and the bass bin of the other popped all because of a website wanting to play audio over my current audio what I was enjoying playing loudly.........

Audio in websites is an annoyands and should be offered AS a PREFERENCE not IMPOSED on the individual.
Copy linkTweet thisAlerts:
@vinnetouJun 06.2007 — you can use something like this:

javascript:

function playSound(){

document.getElementById("sound").play();

}

HTML

<body onload="playSound()">

<embed id="sound" src="ding.wav" width="" height="" hidden="true" autostart="false"></embed>

........
Copy linkTweet thisAlerts:
@felgallJun 06.2007 — The ONLY acceptable way to attach sound to a web page if you want return visitors is:

<a href="mysound.mid">Play Music</a>

Do not use <embed> or <object> and definitely do not use .wav files.
×

Success!

Help @d17may spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...