Resource Page DescriptionAn example of a C# .NET Class that wraps a MediaPlayer and repeats the playback of a WAV file in a loop until stop method is called.
This was a "hack" i put together to get around using MediaTimeline technique that simply did not work for me for some reason.
For more information on MediaPlayer class see:
http://msdn.microsoft.com/en-us/library/system.windows.media.mediaplayer.aspx For more information on MediaTimeline class see:
http://msdn.microsoft.com/en-us/library/system.windows.media.mediatimeline.aspx Usage Example If you are not sure how to use this very simple class, here is an example:
public Form1()
{
InitializeComponent();
}
RepeatMediaPlayer mediaRepeat;
private void Form1_Load(object sender, EventArgs e)
{
const string FilePath = @"C:\temp\Testing 1 2 3\testing
12.wav";
mediaRepeat = new RepeatMediaPlayer(FilePath);
mediaRepeat.Play();
}
private void buttonStop_Click(object sender, EventArgs e)
{
mediaRepeat.Stop();
}
private void buttonPlay_Click(object sender, EventArgs e)
{
mediaRepeat.Play();
}