2 Replies Latest reply on Nov 21, 2006 5:55 PM by Snej45

    How to volume control video voice and background music

    Snej45
      I would like to control the volume of a person speaking in a video and the volume of background music independently from each other with two volume bars.

      However this far I can only:
      1) Control volume on voice and music on same time (but not independently)
      2) Control music but not voice

      Here is the actionscript that controls the music. The voice actionscript is thought as being almost totally similar.

      I am using Flash 8. Name of video (imported flv) is LD.

      bgSound2 = new Sound(this);
      bgSound2.attachSound("Guitar");
      bgSound2.start(0, 99);
      bgSound2.setVolume(0);
      playB.enabled=false;
      slider2.slideBar2._x = 20;
      slider2.slideBar2.onEnterFrame = function() {
      bgSound2.setVolume(0-(this._x));
      };
      slider2.slideBar2.onPress = function() {
      startDrag(this, false, 280, this._y, 0, this._y);
      };
      slider2.slideBar2.onRelease = slider2.slideBar2.onReleaseOutside=function () {
      stopDrag();
      };
      stopB.onRelease = function() {
      bgSound2.stop();
      playB.enabled=true;
      stopB.enabled=false;
      gotoAndStop("playB");
      };
      playB.onRelease = function() {
      bgSound2.start(0, 99);
      playB.enabled=false;
      stopB.enabled=true;
      };stop();
        • 1. Re: How to volume control video voice and background music
          Level 7
          I am not sure what the this converts to (path wise) in your

          bgSound2 = new Sound(this);

          But if you want to control the volume independently you have to make
          sure that your new Sound() declarations do not point to the same
          movieclips. Meaning, you should do

          bgSound2 = new Sound(bgsound_mc);
          VOSound2 = new Sound(vosound_mc);

          JG


          Snej45 wrote:
          > I would like to control the volume of a person speaking in a video and the
          > volume of background music independently from each other with two volume bars.
          >
          > However this far I can only:
          > 1) Control volume on voice and music on same time (but not independently)
          > 2) Control music but not voice
          >
          > Here is the actionscript that controls the music. The voice actionscript is
          > thought as being almost totally similar.
          >
          > I am using Flash 8. Name of video (imported flv) is LD.
          >
          > bgSound2 = new Sound(this);
          > bgSound2.attachSound("Guitar");
          > bgSound2.start(0, 99);
          > bgSound2.setVolume(0);
          > playB.enabled=false;
          > slider2.slideBar2._x = 20;
          > slider2.slideBar2.onEnterFrame = function() {
          > bgSound2.setVolume(0-(this._x));
          > };
          > slider2.slideBar2.onPress = function() {
          > startDrag(this, false, 280, this._y, 0, this._y);
          > };
          > slider2.slideBar2.onRelease = slider2.slideBar2.onReleaseOutside=function () {
          > stopDrag();
          > };
          > stopB.onRelease = function() {
          > bgSound2.stop();
          > playB.enabled=true;
          > stopB.enabled=false;
          > gotoAndStop("playB");
          > };
          > playB.onRelease = function() {
          > bgSound2.start(0, 99);
          > playB.enabled=false;
          > stopB.enabled=true;
          > };stop();
          >
          >
          • 2. Re: How to volume control video voice and background music
            Snej45 Level 1
            Thanks for the response JG.

            If I only had one sound file I would do what you write.
            Apparently I need “Sound(this)” when working with more sound files

            Unfortunately the problem is that I have a combination of a sound file (music) and a video file (voice)…and nothing seems to work.

            Jens