Results 1 to 6 of 6

Thread: play mp3's

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Posts
    63

    Post

    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

  2. #2

    Thread Starter
    Member
    Join Date
    Nov 1999
    Posts
    63

    Post

    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


  3. #3
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    New Jersey
    Posts
    334

    Post

    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


  4. #4
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309

    Post

    I would like to play a mp3 when I click a button.

    howto ?

  5. #5
    Hyperactive Member
    Join Date
    Sep 1999
    Posts
    305

    Post

    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.

  6. #6
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309

    Post

    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....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width