1 Reply Latest reply on Jun 12, 2006 3:38 PM by Newsgroup_User

    Directsound with Shockwave

      I have somewhat of a problem with DirectSound on the web. The thing is, I receive an error when using the function dsNewSound() when I have published it.

      I have written as follows:


      on startmovie

      -- Initiate DirectSound
      tresult = dsOpen()

      -- Has an error occured when DirectSound was initiated?
      if tresult = false then
      alert "DirectSound error!"
      end if

      -- preload the file we want to play.
      tpath = " http://localhost/Sommarkurs/DirectSound/Sound_5.WAV"
      gSoundResult = preloadNetThing(tpath)


      on exitframe

      if netDone( gSoundResult ) then

      if voidP( gSoundID ) then

      -- get an ID for the sound we want to play.
      gSoundID = dsNewSound(" http://localhost/Sommarkurs/DirectSound/Sound_5.WAV", 0)

      -- play it!
      dsPlay( gSoundID )

      end if
      end if

      go the frame


      If you want to test the script, then change "localhost" in the URL to "supertank.mine.nu".

      Anyone has any ideas?