コード例 #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);
 }