.wav file.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luis Flores III

    .wav file.

    I would like to make a .wav file play in the browser (i really don't
    want to have to have a player open or even embbed itself, unless of
    course it were to just not be shown, like a hidden field in a form)
    when clicking on a link. Is there anyways to do this, I am pretty sure
    Javascript would be the way to go to accomplish this, but please
    correct me if I am wrong. Thanks

    Luis
  • Evertjan.

    #2
    Re: .wav file.

    Luis Flores III wrote on 23 nov 2004 in comp.lang.javas cript:
    [color=blue]
    > I would like to make a .wav file play in the browser (i really don't
    > want to have to have a player open or even embbed itself, unless of
    > course it were to just not be shown, like a hidden field in a form)
    > when clicking on a link. Is there anyways to do this, I am pretty sure
    > Javascript would be the way to go to accomplish this, but please
    > correct me if I am wrong. Thanks
    >[/color]

    Embedding is not "shown", like a hidden formfield.

    If you mean by "just not be shown",
    "not visible with source hacking",
    you are luckily out of luck.



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)

    Comment

    • VK

      #3
      Re: .wav file.

      for IE:
      The clear case of "the more is not better" =="media insanity".
      A while ago I had the same problem, and the only solution I could produce
      was using the <bgsound> tag.
      It has much more options than usually thought, read MSDN. In brief,
      myBgSound.src = someSrc assignment makes the sound to play again.
      so
      <bgsound id="myBgSound" src="aNullLengt h.wav">
      and later
      myBgSound.src = "someNewSrc.wav "
      equals to play() command

      AFAIK it's the only way to play sounds without popups, unnecessary downloads
      etc.

      For Gesko clones I cannot help. At that time it was NN4 with built-it Java
      Beatnik Player, and it wasn't such a problem.
      I don't know how it works now.


      Comment

      • Andrew Poulos

        #4
        Re: .wav file.

        Luis Flores III wrote:[color=blue]
        > I would like to make a .wav file play in the browser (i really don't
        > want to have to have a player open or even embbed itself, unless of
        > course it were to just not be shown, like a hidden field in a form)
        > when clicking on a link. Is there anyways to do this, I am pretty sure
        > Javascript would be the way to go to accomplish this, but please
        > correct me if I am wrong. Thanks
        >[/color]

        I've used this:

        <object
        style="visibili ty:hidden;"
        classid="CLSID: 22d6f312-b0f6-11d0-94ab-0080c74c7e95"

        codebase="http://activex.microso ft.com/activex/controls/mplayer/en/nsmp2inf.cab#Ve rsion=6,4,5,715 "
        standby="Loadin g..."
        type="applicati on/x-oleobject">
        <param name="FileName" value="media/wav_sample.wav" >
        <param name="AutoStart " value="true">

        <embed type="audio/x-wav"
        src="media/wav_sample.wav"
        hidden="true"
        autostart="true ">
        </embed>
        </object>


        Andrew Poulos

        Comment

        • Phillip Parr

          #5
          Re: .wav file.

          Put this at the top of your web page...


          <embed id="sound1" src="rain.wav" autostart="fals e" hidden="true">


          then this is how to play it...


          <script language="javas cript">
          <!--
          document.getEle mentById("sound 1").Play();
          -->
          </script>


          or to play it with a link...


          <a href="#"
          onClick="javasc ript:document.g etElementById(" sound1").Play() ;">Click here to
          here rain</a>


          Hope this helps
          Phil

          "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
          news:Xns95AA75E 28E561eejj99@19 4.109.133.29...[color=blue]
          > Luis Flores III wrote on 23 nov 2004 in comp.lang.javas cript:
          >[color=green]
          >> I would like to make a .wav file play in the browser (i really don't
          >> want to have to have a player open or even embbed itself, unless of
          >> course it were to just not be shown, like a hidden field in a form)
          >> when clicking on a link. Is there anyways to do this, I am pretty sure
          >> Javascript would be the way to go to accomplish this, but please
          >> correct me if I am wrong. Thanks
          >>[/color]
          >
          > Embedding is not "shown", like a hidden formfield.
          >
          > If you mean by "just not be shown",
          > "not visible with source hacking",
          > you are luckily out of luck.
          >
          >
          >
          > --
          > Evertjan.
          > The Netherlands.
          > (Please change the x'es to dots in my emailaddress,
          > but let us keep the discussions in the newsgroup)
          >[/color]


          Comment

          Working...