Andrej Tozon's blog

In the Attic

NAVIGATION - SEARCH

Visual Studio 2005 RTM - not a myth

Great news... While I was away, giving a talk about ClickOnce at local SLODUG meeting, VS2005 Professional ed. and SQL2005 Developer ed., together with .NET Framework 2.0 have become available through MSDN subscribers download.

After all these years... VS 2005 finally here. And it's real.  Version numbers... 8.0.50727.42 (VS) or 2.0.50727.42 (Framework).

Make some noise!

The .NET Framework 2.0 finally makes it very easy for your application to play some funky music. First, there's the SystemSounds class, allowing you to play basic, ehm, system sounds like Beep, Exclamation, Question, ... For example: SystemSounds.Asterisk.Play() plays the sound you have selected for the Asterisk event in your active sound scheme.

A bit more interesting is a SoundPlayer class, which lets you choose a custom .wav file to play:

SoundPlayer player = new SoundPlayer(@"c:\Windows\Media\Windows XP Startup.wav");
player.Play();

SoundPlayer lets you load the and play .wav files from a valid URL or a Stream object, in a synchronous or asynchronous manner. And if you really want to annoy your users, then PlayLooping() method is all what you need.