Full Version: Playing mp3,mid,etc... audio files on VB 2010!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Play mp3,mid,... files on VB 2010!

First Of all We need to add a reference to the windows media player (wmp.dll).

1. Go to Project -> Add Reference (see tut1.png)
[Image: tut1ns.png]

2. A Window Should Pop Up, now go to the COM tab and scroll all th way down them just search for Windows Media player
(see tut2.png), then when you found the wmp.dll just select and press OK.
[Image: tut2b.png]

3. Now Go to the toolbox and scroll down till you reach the General Section, inside the general press the right button and selec "Choose Items..."
(see tut3.png)
[Image: tut3j.png]

4. Now go to the COM Components tab and scroll down a bit till you find the Windows Media Player, Select it and Press OK.
(see tut4.png)
[Image: tut4n.png]

5. Now just drag the Windows Media Player Object in the ToolBox(see tut5.png)
[Image: tut5c.png]
and put it anywhere in the form, select the object and go to properties and set "visible" to false.
(see tut6.png)
[Image: tut6l.png]

6. Now you need to include the music file you want into the project simply, drag the file and place it inside the project.
(see tut7.png)
[Image: tut7.png]

7. Now go to the properties from the file you just putted inside the project and change the "Copy to Output" option to "Copy Always".
(see tut8.png)
[Image: tut8v.png]

8. Then Finaly just copy this code on the disered Sub:

AxWindowsMediaPlayer1.URL = <name of the file>


AxWindowsMediaPlayer1.URL = "Promisses.mp3"

(see tut9.png)
[Image: tut9m.png]

Leave your comments...

Thanks Barata.
Great Tutorial Bro
Very helpful. Thanks