The MediaPlayer

The SoundPlayer, SoundPlayerAction, and SystemSounds classes are easy to use but relatively underpowered. In today's world, it's much more common to use compressed MP3 audio for everything except the simplest of sounds, instead of the original WAV format. But if you want to play MP3 audio or MPEG video, you need to turn to two different classes: MediaPlayer and MediaElement. Both classes depend on key pieces of technology that are provided through Windows Media Player. However, there's a catch—they require Windows Media Player version 10 or later. Windows Vista makes the cut easily, because it includes Windows Media Player 11, but existing Windows XP installations have no such guarantee.

NOTE

Windows XP introduces another catch ...

Get Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.