For C++ there is a function, PlaySound, that can be used to, uh, play sounds. Is there something like this for C#? I have an application that I want to play a system sound when it starts, to annunciate its initiation.
There has GOT to be a way. I hope.
I want to put this at the end of my Form_Load event:
private void Form1_Load(object sender, EventArgs e)
{
/*
A bunch of configuration and initialization stuff
*/
PlayBeepBoop();
}
private void PlayBeepBoop()
{
PlaySystemSound("Beep");
}
There's a SystemSounds
class that sounds like what you might want:
SystemSounds.Beep.Play();
It corresponds to whatever "wav" file you have set as the "Default Beep" in Windows' sound settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With