6 Replies Latest reply on May 10, 2007 2:59 PM by Newsgroup_User

    Controlling system volume

    EL_devin
      Hello,

      I'm sure there is a simple script that once a user launches the projector it will set their system volume to 50%, then when they exit the projector there volume will return.

      Please help

      Thanks,
      Devin
        • 1. Re: Controlling system volume
          Level 7
          Director can natively only control it's own sound volume (lookup
          commands like volume()in the help for specifics).

          The BuddyAPI xtra (www.mods.com.au/budapi) has a few functions that can
          help you out with respect to the system volume, not just the Director
          environment.

          baGetVolume() will tell you what it is now (save that in a global
          variable so you can reset it when you are done)

          baSetVolume() will set the system volume.
          • 2. Re: Controlling system volume
            EL_devin Level 1
            That's cool because I own the BuddyAPI xtra. I was thinking of doing this as a frame script. Would you be so kind as to show me a sample script. I am still very new to lingo. Thanks for all the help.

            Devin
            • 3. Re: Controlling system volume
              Level 7
              Put this in a movie script

              -------volume control--------
              global gOldVolume

              on getSystemVolume
              gOldVolume=baGetVolume("wave")
              end

              on setSystemVolume vNewVolume
              baSetVolume("wave",vNewVolume)
              end

              on resetSystemVolume
              baSetVolume("wave",gOldVolume)
              end
              ------end volume control-------


              Any time before you try setting the volume, run this once:

              getSystemVolume()

              Then, when you want to change the volume, do this:

              setSystemVolume(someNumber)

              where someNumber is an integer from 0 through 100. 0 means mute. 100
              means as loud as it can be. You can call that as many times as you want
              to change the volume as you please.

              Then to reset it back to the way it was before you got to it, use this
              command:

              resetSystemVolume()

              A good place to put that is on stopMovie (or on your exit button, or
              whatever is the last thing that is done before the movie is closed.

              • 4. Re: Controlling system volume
                EL_devin Level 1
                Hey Mike,

                Thanks for all your help. I had to change "wave" to "master" and the script works great.

                Thanks again
                Devin
                • 5. Re: Controlling system volume
                  Level 7
                  Am I way off? Doesn't the soundLevel with a value of 0-8 control the system
                  volume? Or was this done away with in MX 2004?


                  --
                  Craig Wollman
                  Lingo Specialist
                  Word of Mouth Productions
                  212-928-9581

                  www.wordofmouthpros.com
                  "EL_devin" <webforumsuser@macromedia.com> wrote in message
                  news:f1vfii$ju8$1@forums.macromedia.com...
                  > Hello,
                  >
                  > I'm sure there is a simple script that once a user launches the projector
                  > it
                  > will set their system volume to 50%, then when they exit the projector
                  > there
                  > volume will return.
                  >
                  > Please help
                  >
                  > Thanks,
                  > Devin
                  >


                  • 6. Re: Controlling system volume
                    Level 7
                    That works too. But as you pointed out, you are limited to levels 0-7.
                    I think it is better to use Buddy and get a lot more control.