Playing a mp3 file at button click event in windows form

audio-player, c#, mp3, winforms

Solution

You can use WindowsMediaPlayer COM control to play mp3.

Here is a guide from msdn.

WMPLib.WindowsMediaPlayer player = new WMPLib.WindowsMediaPlayer();
player.URL = @"track.mp3";
player.controls.play();

Also you can use SoundPlayer to play wav files. There are also several third party .net mp3 libraries.

Problem

How to play a .mp3 file during the button click event in windows form? I'm new to C# and any pointers to this will be really helpful.

Original source