borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Strange MediaPlayer behaviour)Next Topic (system freeze-up with VB6 app) New Topic New Poll Post Reply
AndreaVB Forum : Multimedia : playing mp3's
Poster Message
Nicholas
Level: Big Cheese

Registered: 31-08-2002
Posts: 22

icon 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
View Profile Send Email to User Show All Posts | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon 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)
        
        Label1.Caption = "Current Song: " & lstPlayList1.ListItems(Index).ListSubItems(1).Text & " by " & lstPlayList1.ListItems(Index).ListSubItems(2).Text
        'Label1.Caption = "Current Song: " & Right(lstPlayList.List(Index), Len(lstPlayList.List(Index)) - Len(Str(Index)) - 1)
        sFormTitle = frmMain.sPlayerName & " - [" & lstPlayList1.ListItems(Index).ListSubItems(1).Text & "-" & lstPlayList1.ListItems(Index).ListSubItems(2).Text & "]  "
        frmMain.Caption = sFormTitle
        'HCSSlider1.Max = MediaPlayer1.Duration
        'HCSSlider1.Min = 0
        lstPlayList1.ListItems(Index).Selected = True
        lstPlayList1.ListItems(Index).EnsureVisible
        lstPlayList1.ListItems(Index).Bold = True
        lstPlayList1.ListItems(Index).ListSubItems(1).Bold = True
        lstPlayList1.ListItems(Index).ListSubItems(2).Bold = True
        lstPlayList1.Refresh
    End If
End Sub


and obviously, with this code you'll need a mediaplayer control.

____________________________
Been busy trying to take a second degree <--it's not working out...

18-01-2003 at 06:32 PM
View Profile Send Email to User Show All Posts | Quote Reply
sajoo
Level: Big Cheese

Registered: 17-05-2003
Posts: 22
icon Re: playing mp3's

hi
  I do this ciding

but i can't find the istplaylist control, how i can place it on the form pls tell me




____________________________
sajoo

26-05-2003 at 07:59 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
sajoo
Level: Big Cheese

Registered: 17-05-2003
Posts: 22
icon Re: playing mp3's

hi
  I do this ciding

but i can't find the "istplaylist1" control, how i can place it on the form pls tell me




____________________________
sajoo

26-05-2003 at 07:59 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: playing mp3's

i believe that's a listbox you need on your form

  sorry i forgot to tell you

____________________________
Been busy trying to take a second degree <--it's not working out...

26-05-2003 at 05:45 PM
View Profile Send Email to User Show All Posts | Quote Reply
sajoo
Level: Big Cheese

Registered: 17-05-2003
Posts: 22
icon Re: playing mp3's

hi

but in which control i will find it
i mean

in component  tab what option i should select


thankx
sajoo

____________________________
sajoo

27-05-2003 at 12:27 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: playing mp3's

well, the listbox i am tokn about is actually the FileListBox, which is in your toolbar already. it's a common control.



____________________________
Been busy trying to take a second degree <--it's not working out...

29-05-2003 at 05:57 PM
View Profile Send Email to User Show All Posts | Quote Reply
sajoo
Level: Big Cheese

Registered: 17-05-2003
Posts: 22
icon Re: playing mp3's

Hi

Thankx  again


sajoo





____________________________
sajoo

30-05-2003 at 05:24 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : Multimedia : playing mp3's
Previous Topic (Strange MediaPlayer behaviour)Next Topic (system freeze-up with VB6 app) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder