Results 1 to 4 of 4

Thread: How do I create a button to play an mp3 file with users default mp3 player?

  1. #1
    Guest

    Question

    I am VERY new to VB, and am currently using VB6 Professional. I am trying to write a program that will, when a button is pressed, play a certain MP3 file. The trick (for me) is that I need the users DEFAULT MP3 player to load up, and start playing the MP3 file, all the while the user is able to still work with the program that is calling for the MP3 to play. Any help will be appreciated. I am new, so go easy on me if you have a solution. Thanks.

  2. #2
    Guest
    I got a line to do what I think you want:

    Dim a As String
    a = Shell("start c:\songfile.mp3", vbHide")

    I'll explain how this one works (I can't say that this will work in Windows NT, or 2k, but it works in 98 and should work in 95).

    The "a = " is because the Shell command returns information. You won't need to use anything that it returns as far as I know. The shell command is used to run programs. For example, Shell("C:\windows\notepad.exe", vbNormalFocus) would start up notepad if that's the correct location, it would also have the focus and be in the normal sized mode. The reason I used the "start" after shell is because that will lauch a file type with it's defaut action. My default for an mp3 file is to load up my player and add it to my play list. It is probably impossible to make the file play automaticaly if the user doesn't have their player set up that way.

    Hope this all make sense. If you have any questions, mail me at [email protected].

  3. #3
    Guest
    Thanks, you have just made my day. I have been going through book after book trying to find something that simple. Thanks.

  4. #4
    Guest

    Smile

    I'm very happy I was able to help. This is a great board for any question. I've probably learned more by hanging around this board than I have in my VB classes.

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