The Trouble with Trebles...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Tezcatlipoca
    Forum Member
    • Apr 2003
    • 10

    The Trouble with Trebles...

    Ok, Firstly I would like to apologise sincerely for the pun title to this thread. It was very naughty of me, and I promise that once you solves my query I will go and stand in the corner.

    With that out of the way, I'm experiencing a little trouble with the audio part of Autoplay (hence the thread title). I essentially want an introductory sound to play when my menu first loads up, much like the welcome sound for windows.

    At the moment, I'm putting the command to play this .wav in the OnInitialise section of the frontpage setup. It plays fine, but, if I track the mouse over anything that produces a sound before this welcome wave has finished playing, it cuts dead and plays the new sound. This just looks, or, more properly sounds, unprofessional.
    The only alteration to sound playing I can see is the Sychronise checkbox, but if I have that selected, the sound file plays before the menu appears. Effectively, it seems to freeze everything whilst the .wav runs, then loads the menu afterwards. This also looks shoddy and realy not acceptable.

    So, my query is, is it possible to have this welcome sound, or any sound for that matter, play alongside a seperate .wav, such that my user can put in the CD, the menu appears with the welcome wave file, but even before it has finished, the user can start (with full sound if applicable) navigating the buttons?
  • Derek
    Indigo Rose Customer
    • May 2001
    • 1254

    #2
    Re: The Trouble with Trebles...

    Hi - dont use the Action WAV.Play ... instead, use the MediaPlayer Object and adjust the size to almost nothing.
    This allows you to play the 'startup sound' and it doesnt get effected by 'clicks' of other objects.
    -
    = Derek
    ["All glory comes from daring to begin" - fortune cookie]

    Comment

    • Darryl
      Indigo Rose Staff Member
      • Jul 2001
      • 1908

      #3
      Re: The Trouble with Trebles...

      Yes, you could do what Derek suggested, however if you look on your WAV.Play action, you will find an option labeled as "Play synchronous". This option is defined as follows:

      "Select this option if you don't want your AutoPlay application to respond to any further events until the WAV has finished playing. If this option is disabled, the next sound that is played will interrupt the current one if the current one hasn't finished yet."

      That may be what you are looking for. Give it a try.

      Comment

      • Derek
        Indigo Rose Customer
        • May 2001
        • 1254

        #4
        Re: The Trouble with Trebles...

        I tried that too Darryl, but it didnt work properly. The app didnt show upon starting, however, the music played fine ... until a few seconds into it, then the music stopped and the page showed as it should and gave a 'click' upon showing!

        Is this a known issue or, perhaps, something wrong with my test? [time to update to 4.0.0.4]
        -
        = Derek
        ["All glory comes from daring to begin" - fortune cookie]

        Comment

        • Tezcatlipoca
          Forum Member
          • Apr 2003
          • 10

          #5
          Re: The Trouble with Trebles...

          Thanks for the advice, Darryl, but as I said in my original post, I tried that checkbox with unwanted results.

          Derek: Your methods works, but I now get a new problem. Basically I create a Media Browser Object and pointed it at the wav file. On the page properties for the frontpage, I include the Media Browser Object > Play command. However, whenever I try to preview my project, I get a windows error box saying 'Can't find object XXX', where XXX is the name of my media browser object. But, when I click on OK, the preview finishes setting up, and runs exactly as required (i.e. the sound plays and I can navigate other buttons with their sound files behind it). I guess I'd really should be worried about whether this error box will appear on the final build, but mainly I'm confused as to why it appears at all, since it's telling me that it can't find an object which is quite clearly there, and, as proven when the preview loads, it runs quite happily.

          Comment

          • Lorne
            Indigo Rose Staff Member
            • Feb 2001
            • 2729

            #6
            Re: The Trouble with Trebles...

            Make sure you put the action in On Show, and not in On Initialize.
            --[[ Indigo Rose Software Developer ]]

            Comment

            • Lorne
              Indigo Rose Staff Member
              • Feb 2001
              • 2729

              #7
              Re: The Trouble with Trebles...

              The reason it produces that error is because the media player control hasn't been instantiated yet -- it doesn't exist to receive the play command until the objects on the page are created.
              --[[ Indigo Rose Software Developer ]]

              Comment

              • Derek
                Indigo Rose Customer
                • May 2001
                • 1254

                #8
                Re: The Trouble with Trebles...

                Oh yes! Thanx, Lorne [img]/ubbthreads/images/icons/smile.gif[/img]
                -
                = Derek
                ["All glory comes from daring to begin" - fortune cookie]

                Comment

                • Darryl
                  Indigo Rose Staff Member
                  • Jul 2001
                  • 1908

                  #9
                  Re: The Trouble with Trebles...

                  Sorry for not reading carefully enough. My bad.

                  Have you considered converting it to MP3 format instead?

                  Comment

                  • Tezcatlipoca
                    Forum Member
                    • Apr 2003
                    • 10

                    #10
                    Re: The Trouble with Trebles...

                    Thanks all, works perfectly now. On the mp3 format front, I could convert the .wav to an .mp3 I suppose. I hadn't considered it. Is there any advantage to doing so?

                    Comment

                    • Tezcatlipoca
                      Forum Member
                      • Apr 2003
                      • 10

                      #11
                      Re: The Trouble with Trebles...

                      Just one quick point. I've noticed that the mp3 (or wav) now plays as I want it to, but because I've set it to the OnShow criterea, it plays every time I navigate to that page (i.e. go back to the main menu). What I want is for it to play once at the very first startup and that's it. Another thread hints that I can use registry keys to do this, but I have no idea how to go about writing the coding to do this. Any suggestions?

                      Comment

                      • Lorne
                        Indigo Rose Staff Member
                        • Feb 2001
                        • 2729

                        #12
                        Re: The Trouble with Trebles...

                        Don't need registry keys, unless you only want it to play the first time the user ever runs your application (and never again, even if they exit and run it again).

                        If you jsut want to keep it from happening more than once in a single "session," then just set a variable to "true" the first time, and only play the sound if that variable is false.

                        <pre>IF(! %sound_has_played%)
                        // insert action to play sound here
                        %sound_has_played% = true
                        END IF</pre>
                        --[[ Indigo Rose Software Developer ]]

                        Comment

                        • Tezcatlipoca
                          Forum Member
                          • Apr 2003
                          • 10

                          #13
                          Re: The Trouble with Trebles...

                          ummm...ok, but how do I get that code from the screen to my project? I don't see any option for inserting code, and Copy/Paste doesn't work.

                          Comment

                          • Lorne
                            Indigo Rose Staff Member
                            • Feb 2001
                            • 2729

                            #14
                            Re: The Trouble with Trebles...

                            You can't...at least not directly. That's just pseudo-code. Read it to get the gist of what you need to do.

                            Basically, you use a variable (I called it %sound_has_played% but you can call it whatever you want) that gets set to TRUE the first time the sound plays. And, you use an IF statement to only play the sound if that variable is not TRUE. (The ! operator means "not".)

                            The pseudo-code reads like this: "if %sound_has_played% is not true, then play the sound, and set %sound_has_played% to true."

                            With a little help from the user's guide, you should be able to figure it out from there. [img]/ubbthreads/images/icons/smile.gif[/img]
                            --[[ Indigo Rose Software Developer ]]

                            Comment

                            • Lorne
                              Indigo Rose Staff Member
                              • Feb 2001
                              • 2729

                              #15
                              Re: The Trouble with Trebles...

                              A bit more help for 'ya:

                              To do this, you'll need to use 4 actions, in this order:

                              IF
                              WAV - Play
                              Variable - Set Value
                              END IF

                              In the IF, put this text:

                              <font color=green>! %sound_has_played%</font color=green>

                              In the Variable - Set Value action, change the variable name to <font color=green>%sound_has_played%</font color=green>, and use this text for the value:

                              <font color=green>true</font color=green>

                              That's it.
                              --[[ Indigo Rose Software Developer ]]

                              Comment

                              Working...
                              X