Announcement

Collapse
No announcement yet.

Continuos Loop Sound?

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

  • Continuos Loop Sound?

    I'm working on a project, and i want a Mp3 or Wave Sound to start playing as soon when the intro page comes up and continue throught the project. Is this possible. Currently I have it play on mouse rollover on the banner, but once i rollover again it stops and restarts as to be expected. I also have 5 links and i'm thinking i want the loop to continue thru even if i click a link to one of my pages.. Gosh is this possible?

  • #2
    Re: Continuos Loop Sound?

    Well this might not be the best idea but it works.

    1. I made a flash movie 1px by 1px with nothing in it but a .mp3 that was set to loop 100 times.

    2. Then I used SWF Studio v1.0 to make it a transparent .exe with properties set in SWF Studio to exit the .exe with the depresed escape button on the keyboard.

    3. Then in AMS OnIntialize I executed the .exe I made from SWF Studio.

    You can not see it. It is only 1px by 1px. With the escape button both the AMS and SWF Studio .exe are closed.

    Kinda crude but I was in a hurry and it worked.

    Comment


    • #3
      Re: Continuos Loop Sound?

      Well there's a couple ways to do this. AGRO's is best because with Flash you also have some control over the MP3, i.e. volume, panning, looping, start, stop, etc. But I would modify that method by omitting the step with SWF studio. Simply create a flash movie and plunk your sound down on frame 2 and put a stop action on frame one. That allows you to insert it at design time without having the sound start. Simply add a flash object seek to frame 2 and play (Frame 2 will actually be "frame 1" since AMS's flash frame handling is zero based as per Macromedia's reccomendations) to the page's "On Show" actions area...

      In Flash MX you can set your sound to loop up to 99,999 times...

      Find an unused area on your page 1 X 1 pixels and insert your flash there, use the override background color feature of AMS if needed to make it fit in, and that's all you need...

      You can also do this very easily purely in AMS but there's a small gap of silence when the loop retstarts so it may not work unless your music is 2-3 minutes long and can handle a quick gap like that. To do this simply drag your MP3 into the distribution folder in your distribution bar and then double click on your first page and set "On Initialize" to:

      1. MP3 OBJECT > LOAD to load your sound...
      2. 1. MP3 OBJECT > SET REPEAT > TRUE to engage looping...
      3. MP3 OBJECT > PLAY to get the ball rolling...

      Hope that helps...

      Corey Milner
      Creative Director, Indigo Rose Software

      Comment


      • #4
        Re: Continuos Loop Sound?

        Is there a way to have the song not reset if you change pages. When you change pages and come back to the page with the song, it restarts the song.

        This is in reference to the MP3 Object method mentioned above.
        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: Continuos Loop Sound?

          Yes, set a variable to "true" the first time that page is initialized, and then only start playing the music on page open if that variable is false.
          --[[ Indigo Rose Software Developer ]]

          Comment


          • #6
            Re: Continuos Loop Sound?

            I had it all down also, and ran into the same problem. It restarts when you come back to the page. On the set variable i assume clicking on variable" Set Variable" change default to True, then i'm lost where to do you set the false expression?

            Comment


            • #7
              Re: Continuos Loop Sound?

              OK,

              So sorry to be dense. If I set the actions on the Initialize page to something like

              %visit%="false"

              On the Show page do something like
              If (%visit% = "false")
              MP3.Load(song)
              MP3.SetRepeat (TRUE)
              MP3.Play
              %visit%="true"
              EndIf
              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


              • #8
                Re: Continuos Loop Sound?

                Almost right. Just get rid of the part where you set %visit% to false on the page's "On Initialize" event. Otherwise, it will be set to false every time you jump to that page, defeating the entire purpose.

                Variables pretty much start out resolving to false (because all strings except the word "true" are considered false, and until you assign a value to a variable, it's just like any other string), so you can leave it unassigned until it gets set to true...or, you could explicitly set it to "false" in the project's "On Initialize" event, so it will only be initialized once.
                --[[ Indigo Rose Software Developer ]]

                Comment


                • #9
                  Re: Continuos Loop Sound?

                  Here is what I ended up doing and it works well

                  <IR_ACTIONS_LIST>
                  <Action name="IF">
                  <Type>200</Type>
                  <Function>1</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Condition> ! (%visit% = "true")</Condition>
                  </Action>
                  <Action name="Load">
                  <Type>105</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <MP3File>%SrcDir%\song.mp3</MP3File>
                  <External>1</External>
                  </Action>
                  <Action name="Set Repeat">
                  <Type>132</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Repeat>TRUE</Repeat>
                  </Action>
                  <Action name="Play">
                  <Type>106</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  <Action name="Set Value">
                  <Type>6</Type>
                  <Function>0</Function>
                  <DTIndentLevel>1</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  <Variable>%visit%</Variable>
                  <Value>true</Value>
                  <Evaluate>0</Evaluate>
                  </Action>
                  <Action name="END IF">
                  <Type>201</Type>
                  <Function>1</Function>
                  <DTIndentLevel>0</DTIndentLevel>
                  <Enabled>1</Enabled>
                  <ErrorHandling>
                  <UserNotificationMode>2</UserNotificationMode>
                  <CustomErrorMessage/>
                  <OnErrorAction>0</OnErrorAction>
                  <JumpToLabel/>
                  </ErrorHandling>
                  </Action>
                  </IR_ACTIONS_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


                  • #10
                    Re: Continuos Loop Sound?

                    Wow TJ, where did you put all that? I wish i was more on the programming side.......

                    Comment


                    • #11
                      Re: Continuos Loop Sound?

                      It is not really that much. Copy that entire txt block and put it in the "On Initialize" event for the start page. It will format itself to look like an earlier post of mine. It worked well. I am now working on adding a button to stop the music, if the person viewing the application doesn't want to hear it or if I have the time I have thought of adding the option of having the person select some other song.
                      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


                      • #12
                        Re: Continuos Loop Sound?

                        Thanks TJ, it worked and i'm cheesing... you have a great idea let me know,something i'd like to add also.. Gosh if i can continue to pull this off the Real-Estate company will be tooooooooo happy.... My only other issue is the jpeg i'm using i need to size correctly witha border around them, anyway thanks

                        Comment


                        • #13
                          Re: Continuos Loop Sound?

                          BTW, you can change your condition from:

                          ! (%visit% = "true")

                          to just:

                          !%visit%

                          ...if you want. [img]/ubbthreads/images/icons/smile.gif[/img] They both mean "if %visit% is not true."

                          %visit% = "true"

                          ...and:

                          %visit%

                          ...are both exactly the same.
                          --[[ Indigo Rose Software Developer ]]

                          Comment


                          • #14
                            Re: Continuos Loop Sound?

                            Thankyou for the help again. Anything to simplify.

                            Is there a way to have AMS play one MP3 and when finished play the next one in line. Rather than looping one song.

                            Thanks again.
                            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


                            • #15
                              Re: Continuos Loop Sound?


                              Is there a way to have AMS play one MP3 and when finished play the next one in line. Rather than looping one song.
                              Yep. Just put actions on the MP3 player's "On Song End" event.

                              The best way is probably to use a Global List of filenames, start with the first one, and on song end, get the next one in the list and play that...or you could just use a delimited list stored in a variable (building the list from whatever's in a certain folder with a "File - Search" action)...the sky's pretty much the limit there.
                              --[[ Indigo Rose Software Developer ]]

                              Comment

                              Working...
                              X