如何将其他声音静音,而不是我在C#中的应用程序?

时间:2013-09-13 11:51:30

标签: c# windows-media-player

以下是我的项目代码的一部分。它包含TimerWindows Media Player等。这个项目呢,  这里有五个用户给定的时间以及何时达到当前时间,然后WMP将播放。 你能建议一个代码:    在WMP中播放时,将所有其他声音静音,只能听到WMP的声音。

 public void play(string tune)
    {          
        if (label1.Text == label6.Text || label2.Text == label6.Text || label3.Text == label6.Text || label4.Text == label6.Text || label5.Text == label6.Text)
        {
            axWindowsMediaPlayer1.URL = tune;
            if (label6.Text == label1.Text)
            {
                DialogResult yn = MessageBox.Show("Times to reach pray LUHAR", "Attention Pls:", MessageBoxButtons.OK);
                if (yn == DialogResult.OK) { axWindowsMediaPlayer1.Ctlcontrols.stop(); }

            }
            else if (label6.Text == label2.Text)
            {
              DialogResult yn = MessageBox.Show("Times to reach pray ASAR", "Attention Pls:", MessageBoxButtons.OK);
              if (yn == DialogResult.OK) { axWindowsMediaPlayer1.Ctlcontrols.stop(); }
            }
            else if (label6.Text == label3.Text)
            {
                DialogResult yn = MessageBox.Show("Times to reach pray MAGRIB", "Attention Pls:", MessageBoxButtons.OK);
                if (yn == DialogResult.OK) { axWindowsMediaPlayer1.Ctlcontrols.stop(); }
            }
            else if (label6.Text == label4.Text) 
            {
                DialogResult yn = MessageBox.Show("Times to reach pray ISHAH", "Attention Pls:", MessageBoxButtons.OK);
                if (yn == DialogResult.OK) { axWindowsMediaPlayer1.Ctlcontrols.stop(); }
            }
            else if (label6.Text == label5.Text)
            {
                DialogResult yn = MessageBox.Show("Times to reach pray SUBAH", "Attention Pls:", MessageBoxButtons.OK);
                if (yn == DialogResult.OK) { axWindowsMediaPlayer1.Ctlcontrols.stop(); }
            }
        }


    }

0 个答案:

没有答案