How to Loop Music In C# (Simple)
Max O'Didily
How to Loop Music In C# (Simple)
Greetings, today we shall be looking at how to loop music using C#. This C# tutorial will teach you how to loop/repeat music using the SoundPlayer class in the System.Media module. This will only work with .wav files and can only be used on a Windows OS.
The SoundPlayer class is included with C# so no new libraries need to be installed. Looping music in C# can be done with a few lines of code. It's super simple. Almost identical to playing audio using C#. Instead of Play(), we do PlayLooping().
However, we also need to make sure our C# program doesn't close, so we need to give it something to do. A simple way could be asking for user input.
Thanks for watching this tutorial on how to loop/repeat music using C#.
Here is a tutorial on how to play music using C#: https://www.youtube.com/watch?v=uZlz1SSisYY
Tutorial on how to stop and start music using C#: https://www.youtube.com/watch?v=1UT0qGfw-iM
Subscribe to keep notified when I upload: https://tinyurl.com/SubMaxODidily
How to Loop Music In C# (Simple) ... https://www.youtube.com/watch?v=oRJSkhiAyHc
13380468 Bytes