SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Sound

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2000
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a way to incorporate a little sound (i.e. a little "bleep") either on mouseover or click, but that will not launch a the little .wav plugin player ?
    Im playin around with a personal site and would like to try that on a mouseover if possible.

    Also, if this works, should I use a .wav ?

    Thanks.


    Ken

  2. #2
    Misfit
    Join Date
    Apr 2000
    Location
    Pennsylvania, USA
    Posts
    2,266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I don't think that's possible. You could make the button in Flash though, then you could have a .wav file play without open an external program.

  3. #3
    SitePoint Addict Drinky's Avatar
    Join Date
    Jan 2001
    Location
    England
    Posts
    338
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can do it with RealPlayer and javascript. I'll get back to you with some code.
    Drinky

  4. #4
    SitePoint Addict Drinky's Avatar
    Join Date
    Jan 2001
    Location
    England
    Posts
    338
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Copy and paste this into a new html file.

    I included extra methods in case you want to do anything else.
    Code:
    <html>
    <head>
    <script language="javascript">
    <!--
    
      function play()
      {
        document.RealPlayer.DoPlay();
      }
    
      function pause()
      {
        document.RealPlayer.DoPause();
      }
    
      function stop()
      {
      	document.RealPlayer.DoStop();
      }
    
      function Beep(){
        document.RealPlayer.DoStop();
        document.RealPlayer.DoPlay();
      }
    
    //-->
    </script>
    </head>
    
    <body>
    <p> <!-- Put this object code somewhere out of the way -->
      <object NAME="RealPlayer" width="1" height="1" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">
        <param NAME="SRC" VALUE="beep.rm">
        <!-- <param NAME="CONTROLS" VALUE="ImageWindow"> -->
        <!-- <param NAME="COTROLS" VALUE="scrollbar"> -->
        <param NAME="AutoStart" VALUE="False">
      </object>
    </p>
      <a href="#" onClick="javascript:Beep();return true;">Click Me</a>
      <div align="right"><a href="#" onMouseover="javascript:Beep();return true;">Hover Over Me</a></div>
    </body>
    </html>
    You need to get RealProducer to create .rm files. Or just use any old sound that realplayer can play.

    Disadvantage -> need realplayer on the client.
    Drinky

  5. #5
    SitePoint Enthusiast
    Join Date
    Sep 2000
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright!! Thanks a lot Dinky - I'll see if I can make it work.

    Thanks for taking your time doing the code, I really appreciate it!!


    Ken

  6. #6
    SitePoint Addict Drinky's Avatar
    Join Date
    Jan 2001
    Location
    England
    Posts
    338
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BTW: this is a windows only solution
    Drinky


Bookmarks

Posting Permissions

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