dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 4 of 5 FirstFirst ... 2345 LastLast
Results 46 to 60 of 66

Thread: Help in Debugging this MP3 Player

  1. #46
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Quote Originally Posted by chokies12
    hello sir good day..dont have idea about this..
    I will put together a little example.

  2. #47
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Quote Originally Posted by chokies12
    sir remember the code you gave me on how to load all the mp3 in the folder..when i load it to my list it doesnt play..
    I thought you had this working. You have all the files in a listbox right? You select one and after selecting use List1.Text to feed your play routine, right?

  3. #48
    Join Date
    Mar 2008
    Posts
    130
    I thought you had this working. You have all the files in a listbox right? You select one and after selecting use List1.Text to feed your play routine, right?
    yup my listbox is working well if i put 1 file at a time..my procedure is browse a file when the file is in my text1.text area i add it to my list box..but i tried to put the whole content of the a folder and add it to my list box..i doesnt play..

  4. #49
    Join Date
    Mar 2008
    Posts
    130
    Private Sub Command1_Click()
    Dim strLoad As String
    List1.Clear
    strLoad = Dir("c:\mp3\*.mp3")
    Do While strLoad > vbNullString
    List1.AddItem strLoad
    strLoad = Dir
    Loop
    End Sub
    this code you gave me i tried this its working well it load all the files in the directory to my listbox..but when i try to play a mp3 song it doesnt play..

  5. #50
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    That code loads the listbox.

    What code to you have to play the song?

  6. #51
    Join Date
    Mar 2008
    Posts
    130
    pick a song in the list select it and press my play button..thats the usuall thing that i do and i works..but when my files are loaded via the directory it doesnt play..maybe because the list only has the title of the song not the complete directory

  7. #52
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    What is the code behind the play button?

  8. #53
    Join Date
    Mar 2008
    Posts
    130
    Code:
    Sub StartPlay()
    
    On Error GoTo error                   'Handle Error
       'Set objects
       Set Player = New FilgraphManager   'Player
       Set PlayerPos = Player             'Position
       Set PlayerAU = Player              'Volume
    
       
       Player.RenderFile List1.Text
       
       AdjustVolume                       'Set Volume
       Player.Run                         'Run player
       
       PlayerIsPlaying = True             'We are playing
       lblStatus.Caption = "Playing..."   'status ng player
       CmdBrowse.Enabled = False          'No file open before stop
       txtFile.Enabled = False            'No change
       
       
      
      
      
    Exit Sub
    error:                                 'Handle error
       CmdBrowse.Enabled = True            'Enable file browser
       txtFile.Enabled = True              'Enable file name text box
    
       
    End Sub
    here it is

  9. #54
    Join Date
    Mar 2008
    Posts
    130
    why doesnt my scroll bar move with the song?here is my code

    Code:
    Private Sub Slider1_Scroll()
    
    Dim CurPos
    
    PlayerPos.CurrentPosition = CurPos
    
    CurPos = Slider1.Value
    
    
    End Sub
    heres is the code i added to in my playbutton
    Code:
    Sub StartPlay()
    
    On Error GoTo error                   'Handle Error
       'Set objects
       Set Player = New FilgraphManager   'Player
       Set PlayerPos = Player             'Position
       Set PlayerAU = Player              'Volume
    
       
       Player.RenderFile List1.Text
       
       AdjustVolume                       'Set Volume
       Player.Run                         'Run player
       
       PlayerIsPlaying = True             'We are playing
       lblStatus.Caption = "Playing..."   'status ng player
       CmdBrowse.Enabled = False          'No file open before stop
       txtFile.Enabled = False            'No change
       Slider1.Max = PlayerPos.Duration  '<<<<<this one
       
       
       
      
      
      
    Exit Sub
    error:                                 'Handle error
       CmdBrowse.Enabled = True            'Enable file browser
       txtFile.Enabled = True              'Enable file name text box
    
       
    End Sub

  10. #55
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    This: Player.RenderFile List1.Text

    doesn't play the file?

  11. #56
    Join Date
    Mar 2008
    Posts
    130
    its plays the files..but when the files are loaded to the list via its directory it does not play because the location of the file is not included in the list..only the file name..but when i use browse then add 1 file at a time it play because the location of the file is included..

  12. #57
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Ahhhh....gotcha. Then do this
    Code:
    Private Sub Command1_Click()
    Dim strLoad As String
    List1.Clear
    strLoad = Dir("c:\mp3\*.mp3")
    Do While strLoad > vbNullString
    List1.AddItem "c:\mp3\" &  strLoad
    strLoad = Dir
    Loop
    End Sub

  13. #58
    Join Date
    Mar 2008
    Posts
    130
    how do i convert the duration of the music?

    i did this

    Text1.Text = PlayerPos.Duration
    but it shows the duration like this "185.652" i think its a string..can you teach me how to convert it to min and sec i want it to show like this "00:00"

    and i made this HScroll bar that will move as the mp3 plays and will act as a navigation to move a certain part of the song..i doesnt move but if you click to a certain point the mp3 moves in to the current position

    here's my code to it

    Code:
    Private Sub HScroll1_Change()
    PlayerPos.CurrentPosition = HScroll1.Value
    End Sub
    
    Private Sub HScroll1_Scroll()
    PlayerPos.CurrentPosition = HScroll1.Value
    
    
    End Sub

  14. #59
    Join Date
    Mar 2008
    Posts
    130
    how do i make the time of the mp3 convert to min and sec

  15. #60
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Here is an example (providing the number being displayed is actually milliseconds, which I think it is)

Similar Threads

  1. automatic mp3 player
    By xiaobai00 in forum VB Classic
    Replies: 3
    Last Post: 10-29-2007, 06:37 PM
  2. play mp3 without windows media player
    By Psirus in forum VB Classic
    Replies: 0
    Last Post: 11-23-2000, 07:52 AM
  3. play mp3 without windows media player
    By Psirus in forum VB Classic
    Replies: 0
    Last Post: 11-23-2000, 07:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center