Click here to Skip to main content
16,012,611 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using Microsoft Visual Studio 2005.

Let's say i have this sound.mp3 on my desktop.
Is there a way to play it via VB.net when i push a button?
Posted

1 solution

C#
var player = new System.Windows.Media.MediaPlayer();
player.Open(new System.Uri("myfile.mp3"));
player.Play();


Try to use this code on button click event. For further guide, have a look at this:

http://msdn.microsoft.com/en-us/library/system.windows.media.mediaplayer[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900