本文整理汇总了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)
{
}
}
}
示例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;
}
示例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";
}
示例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();
}
}
示例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(;;);
}
}
示例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);
}
示例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();
}
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例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);
}
}
示例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();
}
示例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();
}
示例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();
}