当前位置: 首页>>代码示例>>C#>>正文


C# System.Media.SoundPlayer.PlayLooping方法代码示例

本文整理汇总了C#中System.Media.SoundPlayer.PlayLooping方法的典型用法代码示例。如果您正苦于以下问题:C# System.Media.SoundPlayer.PlayLooping方法的具体用法?C# System.Media.SoundPlayer.PlayLooping怎么用?C# System.Media.SoundPlayer.PlayLooping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Media.SoundPlayer的用法示例。


在下文中一共展示了System.Media.SoundPlayer.PlayLooping方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AVForm

        public AVForm(Jid to_Jid)
        {
            try
            {
                callSoundPlayer = new System.Media.SoundPlayer(CSS.IM.UI.Util.Path.CallPath);//视频的呼叫声音;
            }
            catch (Exception)
            {

            }

            InitializeComponent();
            this.Text = "正在与" + to_Jid.User + "视频通话中";
            aVcommunicationEx1.UDPListen();
            if (CSS.IM.UI.Util.Path.CallSwitch)
            {
                try
                {
                      callSoundPlayer.PlayLooping();
                }
                catch (Exception)
                {

                }
            }
        }
开发者ID:songques,项目名称:CSSIM_Solution,代码行数:26,代码来源:AVForm.cs

示例2: SearchandDestroy

        public int SearchandDestroy(bool reset)
        {
            System.Media.SoundPlayer player = new System.Media.SoundPlayer(Properties.Resources.kachu);
            System.Media.SoundPlayer playerInf = new System.Media.SoundPlayer(Properties.Resources.pikapika);

            TargetManager tm = TargetManager.GetInstance();
            Controller controller = Controller.GetInstance();

            int i = 0;
            foreach (Target target in tm.TMTargets)
            {
                i++;

                controller.MoveTo(target.x, target.y);

                player.Play();
                controller.Fire();
                controller.SetNum(controller.GetNum() - 1);

                playerInf.PlayLooping();

                if (i != tm.TMTargets.Count)
                {
                    if (reset == true)
                    {
                        controller.Launcher.Reset();
                    }
                }

                Thread.Sleep(250);
            }

            return i;
        }
开发者ID:jon-churchill,项目名称:ASML,代码行数:34,代码来源:FriendFoeSD.cs

示例3: Start_Animals_Click

        private void Start_Animals_Click(object sender, EventArgs e)
        {
            var strButton_Text=Start_Animals.Text;
            System.Media.SoundPlayer player = new System.Media.SoundPlayer();
            player.SoundLocation = "C:\\temp\\play.wav";
            if (strButton_Text == "Start_Animals")
            {
                player.LoadAsync();
                player.PlayLooping();
                Start_Animals.Text = "Stop";
                timer_animals.Enabled = true;
                //listfile[j].Remove(0);
                //animals.Image = Image.FromFile("c:\\temp\\dog.png");
                //anim
                //Timer timer = new Timer();
                //timer.Interval = 500;
                //timer.Enabled = true;
                //timer.Start();

            }
            else
            {
                player.Stop();
                Start_Animals.Text = "Start_Animals";
                timer_animals.Enabled = false;
            }
            //

            //animals.SizeMode = "StretchImage";
        }
开发者ID:xneo123,项目名称:PictureLottery,代码行数:30,代码来源:Form1.cs

示例4: bgMusic

 private void bgMusic()
 {
     _bgplayer = new System.Media.SoundPlayer(@"C:\Users\Tjark\Dropbox\Bezirksjugendtreffen 2012\Abendprogramm\bgmusic-loop.wav");
     Random rnd = new Random();
     if (rnd.Next(2) == 1)
     {
         _bgplayer.PlayLooping();
     }
 }
开发者ID:nichdu,项目名称:jeopardy,代码行数:9,代码来源:QuestionWindow.cs

示例5: Main

 public static void Main(string[] args)
 {
     bool infinito = args[1] == "-i";
     System.Media.SoundPlayer player = new System.Media.SoundPlayer(args[0]);
     Console.WriteLine("Plaing:"+args[0]);
     if (!infinito)
         player.PlaySync();
     else{
         player.PlayLooping();
         for(;;);
     }
 }
开发者ID:tetradog,项目名称:ZinLock,代码行数:12,代码来源:Program.cs

示例6: game_over

 public void game_over(int wynik)
 {
     System.Media.SoundPlayer player = new System.Media.SoundPlayer();
     player.SoundLocation = "loose.wav";
     if (muzik == true)
     {
     player.PlayLooping();
     }
     Console.Clear();
     for (int i = 0, j= 0 ; i < 25; i++)
     {
     if (i >= j) Clear_line_of_numbers(i - j, 7); if (j<6) j++;
     if (i > 3) { Console.SetCursorPosition(75, i - 4); Console.Write("  ____                         ___                 "); }
     if (i > 2) { Console.SetCursorPosition(75, i - 3); Console.Write(" / ___| __ _ _ __ ___   ___   / _ \\__   _____ _ __ "); }
     if (i > 1) { Console.SetCursorPosition(75, i - 2); Console.Write("| |  _ / _` | '_ ` _ \\ / _ \\ | | | \\ \\ / / _ \\ '__|"); }
     if (i > 0) { Console.SetCursorPosition(75, i - 1); Console.Write("| |_| | (_| | | | | | |  __/ | |_| |\\ V /  __/ |   ");}
     if (i > -1) {Console.SetCursorPosition(75, i);    Console.Write(" \\____|\\__,_|_| |_| |_|\\___|  \\___/  \\_/ \\___|_|   ");}
     Thread.Sleep(60);
     }
     Console.ForegroundColor = ConsoleColor.DarkGray;
     int hoffset = 78;
     int voffset = 30;
     Console.SetCursorPosition(hoffset, voffset++);
     Console.WriteLine("╔══════════════════════════════════════════╗"); Console.SetCursorPosition(hoffset, voffset++);
     Console.WriteLine("╠─────────────Podaj swoje imię─────────────╣"); Console.SetCursorPosition(hoffset, voffset++);
     Console.WriteLine("╠══════════════════════════════════════════╣"); Console.SetCursorPosition(hoffset, voffset++);
     Console.WriteLine("║                                          ║"); Console.SetCursorPosition(hoffset, voffset++);
     Console.WriteLine("╠══════════════════════════════════════════╣"); Console.SetCursorPosition(hoffset, voffset++);
     Console.WriteLine("╠───────────────Twój wynik to──────────────╣"); Console.SetCursorPosition(hoffset, voffset++);
     Console.WriteLine("║                                          ║"); Console.SetCursorPosition(hoffset, voffset++);
     Console.WriteLine("╚══════════════════════════════════════════╝"); Console.SetCursorPosition(hoffset + 20, 36);
     Console.Write(wynik);
     Console.SetCursorPosition(hoffset+2, 33);
     Console.ForegroundColor = ConsoleColor.White;
     Console.CursorVisible=true;
     string name = Console.ReadLine();
     Console.CursorVisible = false;
     Scoreboard scoreboard = new Scoreboard();
     if (name != "")
     {
     Player winner = new Player();
     winner.name = name;
     winner.score = wynik;
     scoreboard.dodaj(winner);
     }
     Thread.Sleep(500);
     player.Stop();
     scoreboard.muzik = this.muzik;
     scoreboard.wypisz(muzik);
 }
开发者ID:gornikp,项目名称:projektKCK,代码行数:50,代码来源:GameViewer.cs

示例7: PlayWAV

 //methods to play different song types
 public static void PlayWAV(String Location, Boolean Repeat)
 {
     //Declare player as a new SoundPlayer with SoundLocation as the sound location
     System.Media.SoundPlayer player = new System.Media.SoundPlayer(Location);
     //If the user has Repeat equal to true
     if (Repeat == true)
     {
         //Play the sound continuously
         player.PlayLooping();
     }
     else
     {
         //Play the sound once
         player.Play();
         System.Media.SystemSound sound = System.Media.SystemSounds.Beep;
         sound.Play();
     }
 }
开发者ID:schuylermartin45,项目名称:LHS-The-Video-Game,代码行数:19,代码来源:Ipod.cs

示例8: Form1

        public Form1()
        {
            InitializeComponent();

            //Sets all labels that track user progress to 0.
            lblAttempt.Text = "0";
            lblCorrect.Text = "0";
            lblWrong.Text = "0";
            lblPercent.Text = "0%";
            lblAnswer.Text = "";

            //Names the form.
            this.Text = "Rondinelli - Math";

            //Plays music and loops.
            System.Media.SoundPlayer music = new System.Media.SoundPlayer(@"01-main-theme-overworld.wav");
            music.PlayLooping();
            music.Play();
        }
开发者ID:CraigRondinelli,项目名称:Math-Tutor,代码行数:19,代码来源:Form1.cs

示例9: playSound

 public void playSound(string soundName, bool looping)
 {
     string path = "..\\..\\Resources\\sounds\\" + soundName + ".wav";
     var sound = new System.Media.SoundPlayer(path);
     if (looping)
     {
         sound.PlayLooping();
     }
     else
     {
         sound.Play();
     }
 }
开发者ID:RisteJovanoski,项目名称:Ladders,代码行数:13,代码来源:Game.cs

示例10: Musicasuper

 /*------------------------------------------
  * MUSICA SUPERMAN
  * Fecha inicio: 18/11/2010
  * Última modificación: 01/12/2010
  * ---------------------------------------*/
 static void Musicasuper()
 {
     musicasuper = new System.Media.SoundPlayer(ubicacion + "superman.wav");
     musicasuper.PlayLooping();
 }
开发者ID:jesuscuesta,项目名称:Csharp,代码行数:10,代码来源:ahorcado.cs

示例11: PlayBGM

        /* ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ */
        /* ■ 関数名:PlayBGM                     ■ */
        /* ■ 内容:BGMを鳴動する処理					         ■ */
        /* ■ 入力:wavefilename                                ■ */
        /* ■ 出力:		                                     ■ */
        /* ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ */
        //WAVEファイルを再生する
        private static void PlayBGM(string wavefilename)
        {
            System.IO.UnmanagedMemoryStream music;
            music = GetwaveFile(wavefilename);
            //再生されているときは止める
            if (player != null)
                StopSound();

            //読み込む
            player = new System.Media.SoundPlayer(music);
            //ループ再生する(DON'T KNOW 非同期とは?)
            player.PlayLooping();
        }
开发者ID:Jkank,项目名称:sister,代码行数:20,代码来源:SE.cs

示例12: Window_Loaded

 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     System.Media.SoundPlayer player = new System.Media.SoundPlayer();
     player.Stream = Properties.Resources.主畫面_final;
     try
     {
         //player.Load();
         player.PlayLooping();
     }
     catch (System.IO.FileNotFoundException err)
     {
         MessageBox.Show("找不到音效檔" + err.FileName);
     }
     catch (InvalidOperationException err)
     {
         MessageBox.Show("播放發生錯誤:" + err.Message);
     }
 }
开发者ID:Ray0427,项目名称:Avengers_Rush,代码行数:18,代码来源:MainWindow.xaml.cs

示例13: Musicarocky

 /*------------------------------------------
  * MUSICA ROCKY
  * Fecha inicio: 18/11/2010
  * Última modificación: 01/12/2010
  * ---------------------------------------*/
 static void Musicarocky()
 {
     musicarocky = new System.Media.SoundPlayer(ubicacion + "rock2.wav");
     musicarocky.PlayLooping();
 }
开发者ID:jesuscuesta,项目名称:Csharp,代码行数:10,代码来源:ahorcado.cs

示例14: Home_Load

 private void Home_Load(object sender, EventArgs e)
 {
     System.Media.SoundPlayer player = new System.Media.SoundPlayer(path + @"\Sound\TitleSound.wav");
     player.PlayLooping();
 }
开发者ID:khorokot,项目名称:The-Zappp-Game,代码行数:5,代码来源:HomePage.cs

示例15: ToPaly

 private void ToPaly()
 {
     string Sound = Application.StartupPath + "\\扫书成功.wav";
     //clsPalyWave.Play(Sound);
     System.Media.SoundPlayer sndPlayer = new System.Media.SoundPlayer(Sound);
     sndPlayer.PlayLooping();
     Tpaly.Abort();
 }
开发者ID:rsdgjb,项目名称:ScanApplication,代码行数:8,代码来源:复件+MainForm.cs


注:本文中的System.Media.SoundPlayer.PlayLooping方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。