Make a MP3 Player in vb.NET 2003
Digg! This Page
For the limited amount of you that are like me who still use Visual Basic .NET 2003 then here's a little tutorial to create a really simple MP3 player in vb.NET 2003.Step 1
First, open vb.NET and create a new Windows Application (New Project -> Visual Basic Projects -> Windows Application) then name it something like MiniMP3.

Step 2
Add a TextBox and a Button to the form

Step 3
Now for sound to play we'll be using a DirectX DLL file, which if you don't have you can download it here. To use it, you will need to add it as a reference to the form, so right click the references folder in the Solution Explorer and choose Add Reference.

Locate in the list of .NET References a component named Microsoft.DirectX.AudioVideoPlayback, press Select and it should go into the box below, when it does hit OK.

Step 5
Now double click Button1 and it'll show you the code. At the top you will need to put:
Imports Microsoft.DirectX.AudioVideoPlayback(This calls the reference). Next you will need to put this bit of code between the Private Sub Button1_Click bit and End Sub.
Dim playAudio As Audio playAudio.FromFile(TextBox1.Text, True)This makes playAudio a Audio object, then tells it to play a music file from the location typed in TextBox1.

Step 6
If that's all done, then just change the text on your button and form and give it a whirl. You hear the sound yeah? Good. Remember this tutorial is to make a simple audio player - this just gives you the chance to learn how to play sounds in vb.net 2003.

Download Source: MiniMP3.zip



