PDA

Click to See Complete Forum and Search --> : play mp3's


Gerald
Nov 29th, 1999, 12:25 AM
The following code is not fancy, but it does work.

Private Sub Command1_Click()

Dim sCmd As String

sCmd = "mplayer.exe /Play c:\your.mp3"

Shell sCmd, vbMinimizedNoFocus

End Sub

Gerald
Nov 29th, 1999, 12:44 AM
Another way to do this is to include the Multimedia (MCI) control in your VB project. You can then place an MCI control on a form and use the following code in the forms load event.

Private Sub Form_Load()
MMControl1.Wait = True
MMControl1.FileName = "C:\your.mp3"
MMControl1.Command = "Open"
End Sub

spandex44
Nov 29th, 1999, 12:56 AM
Maybe you could use the RealAudio ActiveX control. I know that you can use RealPlayer to play Mp3s, but I'm not sure if the ActiveX control would do the trick. But if it does I recommend you use it because it's very easy to use.

------------------
Regards,
Alexander McAndrew
VB Zone
http://gsenterprise.server101.com

Inhumanoid
Nov 29th, 1999, 11:24 AM
I would like to play a mp3 when I click a button.

howto ?

Bob Baddeley
Nov 29th, 1999, 11:27 AM
go to vbcode.com and do a search for mp3 or look under the music/sound title. There are lots of examples and codes to do it.

Inhumanoid
Nov 29th, 1999, 11:34 AM
I know.... But those are usually complete winamp clone type stuff...

I just want a few lines of code that run an predefined mp3, no fancy ****...

I know I could easily extract that out one of those examples but I thought maybe someone knew on with just a few lines of code by hart...

thanks anyway....