dalehay.com
Search Engine Optimization

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.
Make a MP3 Player in vb.NET 2003 - Part 1

Step 2
Add a TextBox and a Button to the form
Make a MP3 Player in vb.NET 2003 - Part 2

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.
Make a MP3 Player in vb.NET 2003 - Part 3

Step 4
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.
Make a MP3 Player in vb.NET 2003 - Part 4

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.
Make a MP3 Player in vb.NET 2003 - Part 5

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.
Make a MP3 Player in vb.NET 2003 - Part 6

Download Source: MiniMP3.zip

Comments

Comments:

Add your comment...

Your Name:

Your Email:

Your Comment:

Enter This Number:

(39159)


Note: Your IP address is saved into the database when you submit a comment. Any type of threatening behaviour will result in your ISP being contacted and legal action being taken place!





Latest News Stories
» Not good...
» Internet Explorer 8 Problems
» October
» Relaxtion by Dale Hay
» BBC Weather Revamp
» Dog Singing
Top Viewed Stories
» PHP Mini Message Board Tutorial (4,211)
» Rare McDonalds Monopoly 2008 Tickets (3,054)
» PHP Search Engine Tutorial (2,271)
» Helen Willetts Pregnant? (1,399)
» QI Series 6 on BBC One (900)
» Create your own Image Uploader (873)
Most Commented Stories
» PHP Mini Message Board Tutorial (33)
» Create your own Image Uploader (18)
» I like my DuMP (15)
» I'm on Wikipedia! (7)
» Chocie Munchin Niece (6)
» Life on Mars... (6)