7 Replies Latest reply on Apr 24, 2006 3:27 AM by pjjj

    making mp3s reload if loading has failed

    pjjj
      hey
      im trying to play 15 mp3s after each other each one is between 30 -60kb big, they are loading in externally in to 15 sound objects. i have a button that plays them all of the mp3s one after another from an array but they only ever get to about the 7th in then wont play the 3-4next mp3s but will play the last one or two. The names are all correct so i persume its a bandwith loading problem.

      Is there a way to load the mp3s at the end of my sequence while the mp3s at the start of my sequence are playing
      have alook at
      www.trad-guitartuning.com (in Eadgbe section, chords/scales, Gmajor Scale)

      The sound objects are created on the main timeline, the mp3s loaded in on event when you press Gmaj Scale button and put in an array and the array of mp3s played when you hit play. Some of the mp3s dont ever seem to load in is there a way to make any that dont load reload later. Any help would be much appriciated , i can put up my code if required. www.trad-guitartuning.com
        • 1. Re: making mp3s reload if loading has failed
          Level 7

          "pjjj" <webforumsuser@macromedia.com> wrote in message news:e28ll4$hn$1@forums.macromedia.com...
          > hey
          > im trying to play 15 mp3s after each other each one is between 30 -60kb big,
          > they are loading in externally in to 15 sound objects. i have a button that
          > plays them all of the mp3s one after another from an array but they only ever
          > get to about the 7th in then wont play the 3-4next mp3s but will play the last
          > one or two. The names are all correct so i persume its a bandwith loading
          > problem.

          It doesn't like these file names.. they're not on the server and probably shouldn't have # signs in the file names.

          /notes/4f#4_eadgbe.mp3
          /notes/1f#2_eadgbe.mp3


          When I replaced those 2 notes it worked ok. (as far as I can tell)
          tralfaz


          • 2. Re: making mp3s reload if loading has failed
            Level 7

            "pjjj" <webforumsuser@macromedia.com> wrote in message news:e28ll4$hn$1@forums.macromedia.com...
            > hey
            > im trying to play 15 mp3s after each other each one is between 30 -60kb big,

            Additional... You can only have 8 sounds playing at any one time. If you stop the oldest sounds it will play all the notes..

            function playSound()
            {
            // add this next line
            // stop the old sounds to avoid going over 8 at once
            _root.notes[s-8].stop(); // (the invalid numbers below 0 don't matter)

            _root.notes[s].setPan(0);
            _root.notes[s].start();
            ....

            now it seems to be playing all the notes.
            tralfaz


            • 3. Re: making mp3s reload if loading has failed
              pjjj Level 1
              thanks tralfaz
              i will try what you suggested i didnt realize only 8 sounds could play at any one time, i thought for some reason it was 16.
              • 4. Re: making mp3s reload if loading has failed
                pjjj Level 1
                hey
                just one thing you dont know how i would stop the mp3s doubling up on each other when you press the play button multiple times(as some people might be inclined to do). any ideas.
                • 5. Re: making mp3s reload if loading has failed
                  Level 7

                  "pjjj" <webforumsuser@macromedia.com> wrote in message news:e2b29s$5bd$1@forums.macromedia.com...
                  > hey
                  > just one thing you dont know how i would stop the mp3s doubling up on each other when you press the play button multiple times(as
                  > some people might be inclined to do). any ideas.

                  You can clear the interval before setting it so you will only have one set of sounds playing at a time.
                  It doesn't matter if it's never been set yet, clearing a non-existent interval causes no problems.
                  tralfaz

                  clearInterval(soundID); // add this line
                  soundID = setInterval(playSound, 350);



                  • 6. Re: making mp3s reload if loading has failed
                    pjjj Level 1
                    excellent i will give that a go, thanks again
                    • 7. Re: making mp3s reload if loading has failed
                      pjjj Level 1

                      Perfect that little change makes all the differance though for some reason it doesnt work when i put it on the selection buttons which load in the mp3s. When they are pressed while one of them is still playing a set of mp3s, other mp3s start playing out control. Any idea why thats happening.