예제 #1
0
        public static double GetLevel(int count, out double maxLevel, int delayMs)
        {
            double num = 0.0;

            maxLevel = double.NegativeInfinity;
            for (int index = 0; index < count; ++index)
            {
                StringBuilder strReturn = new StringBuilder();
                Mci.mciSendString(Mci.DefinitionSet.StatusLevelCommand, strReturn, 16, IntPtr.Zero);
                double result;
                if (!double.TryParse(((object)strReturn).ToString(), out result))
                {
                    return(0.0);
                }
                num += result;
                if (result > maxLevel)
                {
                    maxLevel = result;
                }
                Thread.Sleep(delayMs);
            }
            return(num / (double)count);
        }
예제 #2
0
 public static void SaveRecording(string fileName)
 {
     Mci.mciSendString(string.Format(Mci.DefinitionSet.SaveCommandFormat, (object)fileName), (StringBuilder)null, 0, IntPtr.Zero);
 }
예제 #3
0
 public static void Close()
 {
     Mci.mciSendString(Mci.DefinitionSet.CloseRecorderCommand, (StringBuilder)null, 0, IntPtr.Zero);
 }
예제 #4
0
 public static void Stop()
 {
     Mci.mciSendString(Mci.DefinitionSet.StopCommand, (StringBuilder)null, 0, IntPtr.Zero);
 }
예제 #5
0
        public static double GetLevel()
        {
            double maxLevel;

            return(Mci.GetLevel(1, out maxLevel, 0));
        }
예제 #6
0
 public static void StartLevelMeter()
 {
     Mci.mciSendString(Mci.DefinitionSet.OpenLevelMeterCommand, (StringBuilder)null, 0, IntPtr.Zero);
 }