示例#1
0
        public static void SetSystemVolume(float fVol)
        {
            if (!volInit)
            {
                // This may fail if there is no sound card present
                try
                {
                    vol = new EndpointVolume();
                }
                catch
                {
                    vol = null;
                }
            }

            // only try this is sound was initialized
            if (vol != null)
            {
                vol.MasterVolume = fVol;
            }
        }
        public static void SetSystemVolume(float fVol)
        {
            if (!volInit)
            {
                // This may fail if there is no sound card present
                try
                {
                    vol = new EndpointVolume();
                }
                catch
                {
                    vol = null;
                }
            }

            // only try this is sound was initialized
            if (vol != null)
            {
                vol.MasterVolume = fVol;
            }
        }