Nicholas Level: Big Cheese Registered: 31-08-2002 Posts: 22
playing mp3's
Hi, I'm trying to make a program that play's a Mp3 file but I'm having a problem getting the file to play, Do I need to add a component for VB6 and then add the control? Thanks for any help. Nick
17-01-2003 at 09:35 PM
|
vbgen Level: Moderator Registered: 10-10-2002 Posts: 876
Re: playing mp3's
hope you can easily grasp what controls you'll need in this code...
Private Sub PlaySong(ByVal Index As Integer)
'Purpose: Load a song, then play it
If Index >= 1 Then
LoadSong Index
Else
LoadSong 1
End If
If MediaPlayer1.Filename <> "" Then
MediaPlayer1.Play
bStopPressed = False
End If
End Sub
Private Sub LoadSong(ByVal Index As Integer)
'Purpose: Loads a song into the mediaplayer and sets properties
If Index <= lstPlayList1.ListItems.Count Then
lstPlayList1.ListItems(iCurrentIndex).Bold = False
lstPlayList1.ListItems(iCurrentIndex).ListSubItems(1).Bold = False
lstPlayList1.ListItems(iCurrentIndex).ListSubItems(2).Bold = False
iCurrentIndex = Index
MediaPlayer1.Filename = lstFilenames.List(Index - 1)