DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 1 of 5 123 ... LastLast
Results 1 to 15 of 66

Thread: Help in Debugging this MP3 Player

  1. #1
    Join Date
    Mar 2008
    Posts
    130

    Help in Debugging this MP3 Player

    hi guys im new here and im new to the visual basic world..i need help in debugging this mp3 player that i got from the internet..i need to know which line is making it play..im using this mp3 player as my reference guide and building a replica of it inorder to understand each line of code...i really need your help..

    Code:
    Dim PlayerIsPlaying As Boolean  'determine when the player is playing
    Dim Player As FilgraphManager   'Reference to our player
    Dim PlayerPos As IMediaPosition 'Reference to determine media position
    Dim PlayerAU As IBasicAudio     'Reference to determine Audio Volume
    Dim i As Integer                'Icon index
    Sub Play()
    
    Dim CurState As Long
     'check player
     If Not Player Is Nothing Then
        'Get the state
        Player.GetState x, CurState
          
        If CurState = 1 Then
          PausePlay
          Exit Sub
        End If
     End If
     
     StartPlay 'Start playing the file
    
    End Sub
    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 txtFile.Text     'Load file
       AdjustVolume                       'Set Volume
       Player.Run                         'Run player
       PlayerIsPlaying = True             'We are playing
       playTimer.Enabled = True           'Start play timer
       lblStatus.Caption = "Playing..."   'Status
       cmdBrowse.Enabled = False          'No file open before stop
       txtFile.Enabled = False            'No change
       VolSlider.SetFocus                 'Remove focus from cmdPlay
       i = 0                              'Animate icon
       GetMP3Tags                         'Load mp3 file tags
       Me.Caption = Me.Caption & " [" & txtInfo.Text & "]"
    
    Exit Sub
    error:                                 'Handle error
       StopPlay                            'Stop player
       cmdBrowse.Enabled = True            'Enable file browser
       txtFile.Enabled = True              'Enable file name text box
       lblStatus.Caption = Err.Description 'Write error description to status label
       
    End Sub
    this is the code that make Play button play the selected mp3 file..but i need to know where is the specific line the make it play..because if i just copy this and paste it in my replica it will just give me error since not all variable are and button are in my replica..im doing a step by step replication of it..

    below is the link for the mp3 player that i got from the internet..
    http://www.sendspace.com/file/tjd59s

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Welcome to DevX

    My guess would be Player.Run

  3. #3
    Join Date
    Mar 2008
    Posts
    130
    that was a fast reply..already found out what part is making it play..but i need to know this lines so when my professor ask me i can easily explain it to him..

    Dim PlayerIsPlaying As Boolean 'determine when the player is playing
    Dim Player As FilgraphManager 'Reference to our player
    Dim PlayerPos As IMediaPosition 'Reference to determine media position
    Dim PlayerAU As IBasicAudio 'Reference to determine Audio Volume
    sir can you explain this to me if its ok to you?i dont have any reference to any of this codes..

    is "PlayerIsPlaying" a visual basic code or the author just made this?
    what is filegraphmanager?

    btw, thank you for you fast reply sir..

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Quote Originally Posted by chokies12
    is "PlayerIsPlaying" a visual basic code or the author just made this?
    The answer to this question is right before you
    Code:
    Dim PlayerIsPlaying As Boolean  'determine when the player is playing
    It is a Boolean variable created by the author.
    Quote Originally Posted by chokies12
    what is filegraphmanager?
    Don't know what this is, but it is being used as a file type. That means some kind of reference to an external file (probably a DLL) is being set and the method and properties of this external file are being used in the program.

    Do Project/References from the IDE and see what is checked off in the reference list.

  5. #5
    Join Date
    Mar 2008
    Posts
    130
    the author said that its using active movie control library..i checked it in my replica..

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Quote Originally Posted by chokies12
    the author said that its using active movie control library..i checked it in my replica..
    Well, then there is your answer.

  7. #7
    Join Date
    Mar 2008
    Posts
    130
    hehe..1by1 im finding out the specific code for each command..btw the player i got only handles 1 file..you must browse again to play another file..how can i make a list of files?like in winamp player you just add all the files you want and it plays 1by1 after the a file is finish..

  8. #8
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Where are all these files located?

  9. #9
    Join Date
    Mar 2008
    Posts
    130


    this is my replica..already done the basic commands..adding now volume slider..

    you can see that i can browse 1 file at a time..what i want to do is to be able to make a List so ill just browse and add the mp3 file to the list. and just click it so i wont always do browsing..like making a playlist..

  10. #10
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Quote Originally Posted by chokies12
    you can see that i can browse 1 file at a time..what i want to do is to be able to make a List so ill just browse and add the mp3 file to the list. and just click it so i wont always do browsing..like making a playlist..
    Yes, I understand this. I asked this question
    Quote Originally Posted by Hack
    Where are all these files located?
    because accomplishing this task will be whole lot simpler if all the files you want are in one folder and not spread out all over your hard drive.

  11. #11
    Join Date
    Mar 2008
    Posts
    130
    my mp3 files are located at C:\mp3

  12. #12
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Is there anything else in that folder besides the mp3 files?

  13. #13
    Join Date
    Mar 2008
    Posts
    130
    nothing all just all .mp3 files

  14. #14
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    What kind of experience do you have using ListBoxs?

    Do you know how to load the contents of a folder into a listbox?

  15. #15
    Join Date
    Mar 2008
    Posts
    130
    sir thank you for helping me

    i dont have any knowledge in listbox..im just new in visual basic..^_^ hope you can help me step by step..

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