Creating Loud Websites

Sign in to queue

The Discussion

  • User profile image
    Pure L

    I'm confused as to where the actual sound file should be called from?

    Let's say the sound file is located at sounds/tada.wav , do I type that url wherever "(url)" is listed in the code?

    Thanks.

  • User profile image
    Tuti

    This sounds like an April Fools Day contribution!

    Who wants all that noise - aren't pop-ups more than enough already?

  • User profile image
    kiran

    Cool way of reinventing the lost glory Wink

    Will experiment with SOunds now ,thank you!

  • User profile image
    Steve Savage

    Do non-Microsoft browsers support any of this?  (Firefox, netscape, safari, etc...)

  • User profile image
    jrthor2

    This script does not work in Safari.  Is there any way to get this working in Safari?

    Thanks.

  • User profile image
    jrthor2

    This method does not work in Safari.  Anyone know how to get ths script working in Safari?

  • User profile image
    Dawg

    BGSOUND is still the best way to play background music on a web page. The W3C will have a fit and so will Microsoft based HTML IDE's about the tag, but it is still supported by IE7 and Netscape.

  • User profile image
    Charan

    simple, excellent & useful article buddie ... gr8 work !!!!!!!!

  • User profile image
    Kemal

    Steve,

    Technically, your article is one of the best short tutorials I have seen anywhere.

    People may or may not like sound on web pages. That is their opinition, and frankly, they are irrelevant.

  • User profile image
    Amit

    I want to pass the sound file url from code behind

    during page load and then want to play that sound file

    on page load.

    I think code behind page load executes prior to client side page load so this is possible but don't know the exact way to do so.

    Please tell me

  • User profile image
    dannzeman

    On line 13 (lines of code, not spaces) the code "snd.src = url;" is where it defines the location. You replace 'url' with the directory where your soud file is located.

  • User profile image
    zaghy2zy_at​_yahoo_dot_​com

    great! now making those surprisingly great effects can grab some attention

    ---does this work on mp3?

    ------yeah, if you use the <object> or <embed> tag

    but if you dont like that info bar, try finding an audio converter for to change mp3 to wave

  • User profile image
    brody

    i am looking for a free web site brodcast music any body has one email me i have rap/rock/metal all i need is a url

  • User profile image
    Tom

    Surely network latency is an issue here?  If I click the "empty trash" button the trash-emptying sound needs to play straight away, not after the delay caused by the browser requesting and receiving the audio file from the server (and then figuring out how to play it).

  • User profile image
    Dylan J

    I can't say that i'm the best web developer in the world, but didn't sounds on web pages go out of fashion a while ago?

    Just my two cents.

  • User profile image
    Coding4Fun : Creating Loud Websites |  Music
  • User profile image
    TJA

    Can you turn the sound off using a onmouse out?  If true, how do you code it -- in relation to the above PlaySound.js and JavaScript?

    Thanks in advance.

  • User profile image
    Clint

    @TJA:  Try removing the sound from the DOM tree on mouse out.  That may work.  I haven't tried but seems logical.

  • User profile image
    Clint

    @TJA:  Email me via the contact link at the top.

  • User profile image
    TJA

    playSound="('')" works fine in IE onmouseout for turning sound off.  In Firefox, however, sound plays until end of wav.  Any way around this?

  • User profile image
    shreya

    bgsound works fine until the window is maximized

    but if you minimize the window we can't hear any sound in IE6

  • User profile image
    Clint

    @Deren, it isn't that simple.  a ASPX page is actually compiled once by the server and requires a few extra bits in it.

    Check out Visual Web Developer Express to make some ASP.Net web pages at https://www.microsoft.com/express/

  • User profile image
    Deren

    It is an excellent article and sincere thanks for posting the JS script.  One simple question:

    in ASP.NET the page extension is SomePage.aspx,  I tried to change

    SomePage.htm  to SomePage.aspx

    but it did not work.

    Could you help, Steve?  Thanks again.

  • User profile image
    deren

    Steve,

    This is a very useful article:

    Using JavaScript Along with ASP.NET

    https://msdn.microsoft.com/en-us/library/aa479011(loband).aspx

Add Your 2 Cents