VB icon

Easy MP3 Player

Email
Submitted on: 1/8/2015 7:12:00 PM
By: ShoreSide (from psc cd)  
Level: Beginner
User Rating: By 8 Users
Compatibility: VB 5.0, VB 6.0
Views: 445
 
     One of the easiest MP3 Player's! Don't understand other MP3 complex code...this is for you!
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Easy MP3 Player
' Description:One of the easiest MP3 Player's! Don't understand other MP3 complex code...this is for you!
' By: ShoreSide (from psc cd)
'**************************************

' Simple MP3 Player
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Dim isPlaying As Boolean
Dim Mp3File As String
Private Sub Command1_Click(Index As Integer)
Mp3File = Chr$(34) + Trim(Text1.Text) + Chr$(34)
Select Case Index
 Case 0
' Start Playing
mciSendString "open " + Mp3File, 0&, 0&, 0&
mciSendString "play " + Mp3File, "", 0&, 0&
isPlaying = True
 Case 1
' Stop Playing
mciSendString "close " + Mp3File, 0&, 0&, 0&
isPlaying = False
End Select
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
If isPlaying = True Then
 ' Stop Playing if we are playing before we exit!
 mciSendString "close " + Mp3File, 0&, 0&, 0&
End If
End Sub


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.