Hi folks, I am trying to play mp3's in VB.net 2008 pro.

I have a button that when clicked will play an mp3 in windows media player. The problem is I can find no coding for this in any of the books that I have.

The other problem is that when I compile the app for release how do I get the folder where the mp3's are stored to be compiled with the app?

Much appreciated.

If any of this is unclear please ask me to clarify.

Red

>I have a button that when clicked will play an mp3 in windows media player.

Did you code? If yes then post it with error description. If no, then use MCI - Media Control Interface window api. To learn more about MCI - read MSDN online pages.
Here is a code to inport MCI functions.

<System.Runtime.InteropServices.ProgId("cMCI_NET.cMCI")>Public Class xxxxxx
 Private Declare Function mciSendString Lib "winmm.dll"  
                Alias "mciSendStringA"(ByVal lpstrCommand As String, 
                   ByVal lpstrReturnString As String, ByVal uReturnLength 
                       As Integer, ByVal hwndCallback As Integer) As 
                                            Integer
Private Declare Function mciGetErrorString Lib "winmm.dll"  
              Alias "mciGetErrorStringA"(ByVal dwError As Integer, ByVal 
                   lpstrBuffer As String, ByVal uLength As Integer) As 
                              Integer
 .....
 ....
end class

>The other problem is that when I compile the app for release how do I get the folder where the mp3's are stored to be compiled with the app?

Use resource file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.