Playing a song in WPF

Posted by Abhisek under WPF category on | Views : 2844
Use the following code to play a song using WPF. You have to specify the path of the song. First you have to add a MediaElement.

<Window x:Class="WpfApplication1.Window1"
Title="Window1" Height="300" Width="300">
<MediaElement Margin="10,10,11,72" Name="mediaElement1" Volume="50" Source="D:\1942 A LOVE STORY\EK LADKI KO.mp3" LoadedBehavior="Play">
<OuterGlowBitmapEffect />

When the window will load it will start playing the song.

Comments or Responses

Login to post response