3 Replies Latest reply on Apr 21, 2009 10:02 PM by Sean_Wilson

    Linking large numbers of sound files in shockwave?

    bobnagel

      I am building a large interactive anatomy presentation for a web page. There is to be about 500 audio narrations associated with objects to be clicked and text associated with the objects. Anyway, I have linked to the external folder in the cast  and uploaded   the swa  sounds to the same Audio folder on the server with the same relative path as when I am workng on my production computer. When I upload my shockwave and view in a browser, there is no sound. (Of course it works fine on the production computer) What is there to do that I am not doing so that I can use these linked sound files? Do I need to preload these files, I thought that was taken care of when I linked the external file to the cast. And If I need to preload, which is the best method when working with hundreds of files?

        • 1. Re: Linking large numbers of sound files in shockwave?
          Sean_Wilson Adobe Community Professional

          Depending on how large the SWA files are (and I'm assuming they really are SWA files or MP3s), you can use a #swa member to stream them. This means they will play much sooner than having to download the entire file, with the downside that the file is never available locally so that if you want to replay it you have to start streaming from your server again. Also, you can't seek to part-way through the file.

           

          If you want to explore this route, try creating a new movie and use the Insert (menu) -> Media Element -> Shockwave Audio... dialog. Give the new member a name (I suggest "SWA" - see the code below), double click it and delete the "Link address" (URL). Drag this member into an empty channel and adjust its span to suit (there is nothing visual associated with it, but it needs a sprite instance to play). Now create a couple of buttons on your stage and add some code to them like the following:

           

          property myURL

           

          on getPropertyDescriptionList
             -- change the #default to be the directory of your online audio files,
             -- that way you need only add the filename ("sound one.swa") to the end
             -- as you add this behavior to your buttons
             return [#myURL: [#comment:"URL of SWA file:", #format: #string, #default: "http://www.your_server.com/audio/"]]
          end

           

          on mouseUp me
             tMember = member("swa")
             tMember.url = myURL
             case tMember.state of
               0: --Cast streaming has stopped.
               1: --The cast member is reloading.
               2: --Preloading ended successfully.
               3: --The cast member is playing.
                 tMember.stop()
               4: --The cast member is paused.
                 tMember.stop()
               5: --The cast member has finished streaming.
               9: --An error occurred.
               10:--There is insufficient CPU space.
             end case
             tMember.play()
          end

           

          If you do use a #swa member for streaming you don't need a castLib of linked sounds

          • 2. Re: Linking large numbers of sound files in shockwave?
            bobnagel Level 1

            Thanks, that may be a good path to take and may be how I will proceed.

            However, you bring up a good point about not being able to

            access the sound locally , everytime I click for that sound I must wait for

            it to start  streaming from the server. Most of the sounds are small

            descriptions and not very large in size at all. What I would like is to load

            the fifty or more that I need for an Interactive Page in the presentation so

            that they can be clicked at will without waiting for the stream to start

            each time. Isn't this possible?

            • 3. Re: Linking large numbers of sound files in shockwave?
              Sean_Wilson Adobe Community Professional
              What I would like is to load

              the fifty or more that I need for an Interactive Page in the presentation so

              that they can be clicked at will without waiting for the stream to start

              each time. Isn't this possible?

              Yes, it's completely possible. I was providing an alternative and outlining its pros and cons.

               

              You will need to issue a preloadNetThing() command against all the sounds you require, and wait for this to finish successfully, if you want them to be available locally to play immediately on demand.