Controlling audio volume

Apr 23, 2010 at 4:39 AM

Hi,

Is it possible to control the volume on the playback? I'd like to mute the video.

Otherwise, great stuff!

Thanks!

Aug 3, 2010 at 7:01 AM
Edited Aug 3, 2010 at 7:02 AM
Hi,

Just wanted to let you know, I found a solution to this problem.

Yes its possible to control the volume. You need a reference to IBasicAudio interface.
// create a refernce to IBasicAudio and store it as a member variable
// Add this line to InitInterfaces() 
ba = (IBasicAudio)fg;

// Now you can change the video volume through IBasicAudio reference
// Add this function to VideoPlayer class
        /// <summary>
        /// Get or set volume of video
        /// </summary>
        public int Volume
        {
            get
            {
                int volume =0;
                if (ba != null) 
                       DsError.ThrowExceptionForHR(ba.get_Volume(out volume));
                return volume;
            }
            set
            {
                if (ba == null) return;
                DsError.ThrowExceptionForHR(ba.put_Volume(value));
            }
        }
Hope this helps.
-abhi