1

I want to play a sound while my splash screen gets data from the server.

The sound file is not too large. I want something like when you start your computer you hear the MSWinXP welcome sound and that while establishing your account.

How can I do that?

thnx

splattne
  • 102,760
  • 52
  • 202
  • 249
BDeveloper
  • 1,175
  • 6
  • 24
  • 44
  • Please make sure this is configurable (ie. you can turn it off - preferrably, leave it off and allow people to turn it on). Unless this is a game, it will annoy a lot of users. – billybob Jan 03 '09 at 07:50

1 Answers1

2

Use System.Media.SoundPlayer. You may need to put this code in Form_Load instead.

    private void button1_Click(object sender, EventArgs e)
    {
        System.Media.SoundPlayer player = new System.Media.SoundPlayer();
        player.SoundLocation = @"C:\Windows\Media\chimes.wav";
        player.Play();
    }
Gant
  • 29,661
  • 6
  • 46
  • 65