Announcement

Collapse
No announcement yet.

mp3 Reading In A Play List

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mp3 Reading In A Play List

    I've read the Document ID: IR04030 (How to set up an mp3 playlist)and have followed its instructions to the letter, or so I believe.

    Now when my project starts my first mp3 plays then ends and my second mp3 starts, whoopee it works !

    But then my second mp3 ends and then my second mp3 starts and then my second mp3 ends and then my second mp3 starts and then my second mp3 ends and then my second mp3 starts etc etc etc.

    I'm being stupid I'm sure. Can someone possibly pin point my stupidity for me. I've got about 17 tracks I'm trying to play and I'm getting bored of mp3 number two !
    :confused:

    Thanks

    Paul

  • #2
    Re: mp3 Reading In A Play List

    " I'm getting bored of mp3 number two ! " ... remove mp3 number two

    seriously, perhaps you could include the actions you are using [or the project] so someone can take a look at it. Bit hard to guess otherwise
    -
    = Derek
    ["All glory comes from daring to begin" - fortune cookie]

    Comment


    • #3
      Re: mp3 Reading In A Play List

      I'm attaching the file here.

      25429-help.txt

      Comment


      • #4
        Re: mp3 Reading In A Play List

        One thing I have noticed about your code is you are using the globallist to get the next item in the list but when you load your MP3 you load using the file name and not the variable. Try this

        THE FOLLOWING IS FROM PROJECT SETTINGS :- On Initialize

        %PlayListFile% =TextFile.Read ("%SrcDir%\playlist.txt")
        GlobalList[PlayList].Add (Beginning, "%PlayListFile%")
        GlobalList[PlayList].SetPosition (First)
        %MP3File% = GlobalList[PlayList].GetItem (Current)
        MP3.Load ("%MP3File%")
        MP3.Play


        THE FOLLOWING IS FROM MP3 PLAYER PROPERTIES :- On Song End

        GlobalList[PlayList].SetPosition (Next)
        %MP3File% = GlobalList[PlayList].GetItem (Current)
        MP3.Load (" %MP3File% ")
        MP3.Play


        I hope this helps
        TJ-Tigger
        "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
        "Draco dormiens nunquam titillandus."
        Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

        Comment


        • #5
          Re: mp3 Reading In A Play List

          The most wonderful thing about Tigger,
          Is Tiggers a wonderful thing....................

          Thanks Bud, all is well in my world again

          Comment


          • #6
            Weird annoyance

            Thanks Tigger, all works as it should now except a weird annoyance. Once all the mp3s have played, and they do play exactly as I want them to, about 45 mins worth, after the last one has played I get an error message pop up telling me something like " unable to locate.........." and then the complete list of mp3s, when quite clearly the mp3s have already been located and played successfully :confused: Curious.

            Any ideas

            Comment


            • #7
              Re: Weird annoyance

              This is just a guess, but are you testing to see if you are at the end of your Global List? If not, put in a simple IF statement to see if you've reached the end, if you have, then end or restart at the begining.

              Comment


              • #8
                Re: Weird annoyance

                I agree with Worm. Based on the Code you posted yesterday there was not a check to see if you were at the end. Simple thing to do would be to use the Global List - Get Property to count the number of items in the list and if the Set Position (Next) action equals that count then stop or start at the begining.
                TJ-Tigger
                "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
                "Draco dormiens nunquam titillandus."
                Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

                Comment


                • #9
                  Re: Weird annoyance

                  Thanks folks,
                  I'll pretend I understand that for the moment, go away, mess around, generally wing it and get back to you if I need to.

                  Thanks again

                  Paul :crazy:

                  Comment


                  • #10
                    Re: Weird annoyance

                    OK Tigger and Worm,

                    It would appear you are dealing witht the brain dead here. I'm not overly sure what things should look like but what ever I try to do either doesn't make sense or doesn't work.

                    Any chance you can show me what it should all look like.
                    This is what I have so far. It works, they all play and then I get the error message.

                    %PlayListFile% =TextFile.Read ("%SrcDir%\playlist.txt")
                    GlobalList[PlayList].Add (Beginning, "%PlayListFile%")
                    GlobalList[PlayList].SetPosition (First)
                    %MP3File% = GlobalList[PlayList].GetItem (Current)
                    MP3.Load ("%MP3File%")
                    MP3.Play

                    After this I'm lost (and am not confident about how I got this far).

                    TIA

                    Paul

                    Comment


                    • #11
                      Re: Weird annoyance

                      That looks good for loading and starting the play list. I would probably have it build the list in the On Page Initialize section of actions and then load and play when the page loads.

                      Then in the On Song End have it compare the current selected item with the total in the list

                      GlobalList[PlayList].SetPosition (Next)
                      %MP3File% = GlobalList[PlayList].GetItem (Current)
                      MP3.Load (" %MP3File% ")
                      MP3.Play

                      In doing some reading you do not need to count or check to see if it is the last or not. The SetPosition command will wrap to the first when it was previously on the last one in the list.
                      TJ-Tigger
                      "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
                      "Draco dormiens nunquam titillandus."
                      Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

                      Comment

                      Working...
                      X