Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: play a wav file

  1. #1
    New Coder
    Join Date
    Feb 2003
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    play a wav file

    hi,

    I have a situation where I would like to play a little sound file as an alert.

    My code looks something like this:

    <cfif someVar is "Y">
    play the sound file
    </cfif>

    So, there's no click or button, etc. I have searched through the forum and have found some rather complex solutions for an event. I could use the body onload event to trigger the play, if that's required.

    Any ideas on how best to achieve this?

    Thank you and Merry Christmas!

    jo

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title> Website </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <style type="text/css">
    <!--
    #music {
    position:absolute;
    left:0;
    top:0;
    width:1px;
    height:1px;
    line-height:0px;
    font-size:0;
    }
    -->
    </style>
    </head>
    <body>
    <div id="music">
    <object width="1" height="1" 
          classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" 
          codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
          standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
          <param name="url" value="http://yoursonghere.wav">
          <param name="uiMode" value="none">
          <param name="autoStart" value="true">
          <param name="loop" value="false">
          <embed type="application/x-mplayer2" 
          pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" 
          showcontrols="false" uimode="none" width="1" height="1" 
          src="http://yoursonghere.wav" autostart="1" loop="false"></embed>
    </object>
    </div>
    </body>
    </html>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •