Preload Audio? - Novice Needs Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • OysterCracker

    #1

    Preload Audio? - Novice Needs Help

    Hi - My js knowledge is pretty much cut-'n-paste, and I'd appreciate a
    little guidance.I have a simple splash webpage that includes an embedded
    ..wav file of about 60kb. Currently, some dial-up users have pretty much
    completed viewing the page before the .wav file starts playing. I'd like to
    delay opening the page until the .wav file has loaded, so that the music
    starts about when the viewer first sees the page. I know there's a risk of
    the delay time turning off some pholks, but I'd like to try it. Is it
    possible? Can someone get me started with the code? Thanks much.
    ~OC~


  • Randy Webb

    #2
    Re: Preload Audio? - Novice Needs Help

    OysterCracker wrote:
    [color=blue]
    > Hi - My js knowledge is pretty much cut-'n-paste, and I'd appreciate a
    > little guidance.I have a simple splash webpage that includes an embedded
    > ..wav file of about 60kb. Currently, some dial-up users have pretty much
    > completed viewing the page before the .wav file starts playing. I'd like to
    > delay opening the page until the .wav file has loaded, so that the music
    > starts about when the viewer first sees the page. I know there's a risk of
    > the delay time turning off some pholks, but I'd like to try it. Is it
    > possible? Can someone get me started with the code? Thanks much.[/color]

    Put up a blank page, with:
    <body onload="documen t.location.href ="realPage.html "'>
    <code here to play the wav>

    When the .wav gets loaded, it will set the page to the actual page.
    Since the .wav *should* then be in the cache, it will play.

    What you have done though is now pissed off a lot of people that have
    had to sit and look at a blank page while your unwanted sound is loaded.


    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javas cript FAQ - http://jibbering.com/faq/

    Comment

    • fenian

      #3
      Re: Preload Audio? - Novice Needs Help


      "OysterCrac ker" <oc@sc.rr.nonon ono.com> wrote in message
      news:GdOYb.1843 8$eL2.1793565@t wister.southeas t.rr.com...[color=blue]
      > completed viewing the page before the .wav file starts playing. I'd like[/color]
      to[color=blue]
      > delay opening the page until the .wav file has loaded, so that the music[/color]


      I was intrigued by your question, and went searching. Found this (at
      http://www.webreference.com/javascri...16/source.html) and created a
      working example from it. I have no idea how this works in anything other
      than ie. The key is document.*mysou nd*.play() - *mysound* refers to the name
      given in the embed tag, where the source file is also identified.

      <html>
      <head>
      <title></title>

      <script>

      function playWav() {

      document.mysoun d.play();


      }
      </script>




      <body onload="playWav ();">

      <EMBED SRC = "SOUND1.WAV "
      HIDDEN = TRUE
      CONTROLS = console
      VOLUME = 100
      LOOP = FALSE
      AUTOSTART = FALSE
      NAME = "mysound"
      MASTERSOUND>

      the rest of the webpage.....


      </body>


      Comment

      Working...