Play MP3 Files Using Windows Media Player
You can use
Microsoft Windows Media Player in your VB application to play MP3 files.
that you must have Windows Media Player installed on your computer.
Add Windows Media Player to your
From VB menu choose Project->Components... then mark the Windows
Media Player check box and press OK. Now drag the Windows Media Player Control to your form.
If you want that
Windows Media Player will be invisible, set its Visible property to False.
Add 3 Command Buttons to your form.
first to play the MP3 file, press the second to stop it, and press the third to
Private Sub Command1_Click()
' replace the
"D:\MP3\MyFile.mp3" below with the Mp3 file
' you want to
Private Sub Command2_Click()
Private Sub Command3_Click()
' if PlayState is 2:
the file is currently playing.
' if PlayState is 1: the file is in pause
If MediaPlayer1.PlayState = 2