4 Replies Latest reply on May 15, 2006 6:49 AM by Applied CD

    Global way to turn off sound?

    Applied CD Level 1
      My main stage is playing a series of MIAWs and I want a way to shut down sound channels 1-7, leaving 8 open for sound effects used by the stage. It's a touch screen application and the client wants the option to turn off the music but retain the audible clicks and other sound effects for user interaction.

      I've tried setting sound(myChannel).volume = 0 where myChannel is looped 1-7. I've tried this both in the main stage just before the MIAW is opened and also in the first frame of the MIAW itself. I manage to shut down any lingo activated sound but sound effects dropped into the two score sound channels still play. I didn't write the MIAW's, I don't want to put conditional tests in those movies every time a sound is played. Is there a global way to shut down a specific sound channel that can not be overridden by the score?
        • 1. Re: Global way to turn off sound?
          Level 7
          Hi,

          I would have thought sound(chan).volume = 0 would have turned off the sound. Have
          you tried:
          sound(chan).pause() or sound(chan).stop()

          regards
          Dean

          Director Lecturer / Consultant
          http://www.fbe.unsw.edu.au/learning/director
          http://www.multimediacreative.com.au

          • 2. Re: Global way to turn off sound?
            Applied CD Level 1
            OK, this is bizarre. If I run the movie in the authoring environment and stop after a few seconds, I can enter put sound(1).volume into the message window and I get back 0 even though I can hear the sound effects in channel 1 clear as day. I deleted the sound effect from channel 1 just to make sure the sound wasn’t puppeted from some rogue script, it’s not.

            Here’s the really strange part. If I have 3 sound effects, A, B, and C; each sound effect is silenced until one of the effects is repeated in the same channel, from that point on the channel is on … so using letters for the sound effect and numbers for the channel I get the following patterns:

            A1-B1-C1-A1-(other sounds in channel 1) is silent until the second play of A in channel 1, sound is on in channel 1 from that point on, even though checking the message window Director still insists sound(1).volume = 0

            A1-B1-C1-A2-B1-(other sounds in channel 1) is silent until the second play of B in channel 1 (note that A in channel 2 did not turn the sound on), after the second B1 sound is on in channel 1 (and still Director thinks sound(1).volume = 0)
            • 3. Re: Global way to turn off sound?
              Level 7
              On Fri, 12 May 2006 14:31:21 GMT, Applied CD posted in
              macromedia.director.lingo:

              > A1-B1-C1-A1-(other sounds in channel 1) is silent until the second play
              > of A in channel 1, sound is on in channel 1 from that point on, even
              > though checking the message window Director still insists
              > sound(1).volume = 0
              >
              > A1-B1-C1-A2-B1-(other sounds in channel 1) is silent until the second
              > play of B in channel 1 (note that A in channel 2 did not turn the sound
              > on), after the second B1 sound is on in channel 1 (and still Director
              > thinks sound(1).volume = 0)

              I'll take a couple of stabs at it.

              If you're using the sound channels in the score, you may need to have an
              empty frame between the sound sprites. Sort of giving Director time to
              take a breath before starting the next sound. Or you might try using Lingo
              to play the sounds instead.

              If they're not already, make sure the sounds are all sampled at the same
              rate and bit depth. This may be needed even if using Lingo to play the
              sounds.



              --
              Mark A. Boyd
              Keep-On-Learnin'
              • 4. Re: Global way to turn off sound?
                Applied CD Level 1
                Thanks Mark,

                I was loosing too much time on this issue so I ended up setting a global boolean gSoundMute and I put all of the sound effects under Lingo control which works fine. For future projects I would like to know if you or anyone else experiences the same problem. As I mentioned earlier, I didn't write the original code so there could be something lurking about that is causing this phenomena, but I doubt it, the project was fairly straight forward. When I get a chance I will also run a test in a "clean" environment. Just FYI: there is about a 20 frame gap between the triggering of each sound effect, I don’t know about the sampling, I’ll have to look.