7 Replies Latest reply on Sep 19, 2006 8:15 AM by zband409

    Sound Balance

    zband409
      How do I control a FLV video's sound balance? For instance, only output the left channel by clicking a button. Thanks
        • 1. Re: Sound Balance
          Rothrock Level 5
          How are you playing the FLV? If you are using the pre-built components, then you would look in the help files for the Component Dictionary and see if there was anything there – my guess there isn't. In that case you would need to find the uncompiled version of the component poke around in its class files (probably for hours) and see if you could get some hacks into it to control that. In the end probably a bad way to go.

          If you've made your own playback you will need to use attachSound to attach the sound to a Sound Object in a MovieClip instance. You can then use all the methods of the Sound class. Personally I would go this route.

          There used to be some great tutorials at gotoAndLearn.com for how to build your own Media Player, but I don't see them right now. If you need help post back.
          • 2. Re: Sound Balance
            zband409 Level 1
            I guess I have to seperate the sound from the video in order to use the Sound functions.
            Thanks.
            • 3. Sound Balance
              jottebotte
              no you dont..

              s = new Sound(InstanceNameOfTheVideoContainer);
              s.setVolume(50);
              • 4. Re: Sound Balance
                Rothrock Level 5
                jottebotte – this actually works? Is that with the Flash 8 media components or is it with using the NetStream class? I had learned the way I mentioned above. It is a little more involved that what you have posted, but not much more.

                And in either case, zband409, it isn't actually separating the sound from the video, it is just where the respective streams are routed inside the Flash player. I also made a mistake it is attachAudio(). Here is what I use:

                var videoConnection = new NetConnection();
                videoConnection.connect(null);
                var videoStream = new NetStream(videoConnection);
                display.attachVideo(videoStream);
                _root.createEmptyMovieClip("vol",340958)
                myVol=new Sound(vol)
                vol.attachAudio(videoStream);

                You can then use any of the Sound methods with myVol.
                • 5. Re: Sound Balance
                  zband409 Level 1
                  Thanks Rothrock & Jottebotte.
                  Rothrock, your method works as well, sorry I'l go with the simple one.
                  Now I got another problem. I was thinking to use setPan function to switch the sound output between left and right speaks. Coz the source video file has 2 different audios in the left and right channel. But now it seems flash just mix both of the audios together after importing(FLV) . Any idea how to solve this problem?
                  • 6. Re: Sound Balance
                    Rothrock Level 5
                    How did you make the FLV? There should be an option to keep the audio as stereo.
                    • 7. Re: Sound Balance
                      zband409 Level 1
                      There is, but what Flash did is mix the two channels together first and then split to stereo.
                      I simply used the import video in Flash.