Results 1 to 8 of 8
  1. #1
    shruts is offline Member
    Join Date
    Jul 2011
    Posts
    12
    Rep Power
    0

    Default how to stop audio(mp3)

    Java Code:
            if(e.getActionCommand(). equals("Stop")){
                player.stop();
            }
    i have my program in which i am making a mp3 player. i want to stop a song but when i write player.close() it pauses the song rather than stopping it. what should i do to stop my song keeping in mind i have to play another song later and don't have to deallocate and close the player.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,443
    Rep Power
    25

    Default

    What does the API doc for the player class say?

  3. #3
    shruts is offline Member
    Join Date
    Jul 2011
    Posts
    12
    Rep Power
    0

    Default

    the API code jus gives three methods "play loop and stop" and stop method pauses the mp3

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,443
    Rep Power
    25

    Default

    After you stop the playing of song 1, you want to start the playing of song 2? You are done with song 1.
    Can you start song 2 the same way as you started song 1?

  5. #5
    shruts is offline Member
    Join Date
    Jul 2011
    Posts
    12
    Rep Power
    0

    Default

    yes i can select the 2nd song in thse same way as i did fr the 1st song. but here i want to stop the song

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,443
    Rep Power
    25

    Default

    What is the difference between pausing and never restarting
    and stopping?

  7. #7
    shruts is offline Member
    Join Date
    Jul 2011
    Posts
    12
    Rep Power
    0

    Default

    the stop button in any media player stops the song so that if played it starts from the beginning. i want this functionalityu

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,443
    Rep Power
    25

Similar Threads

  1. Looping audio?
    By AndroidAppNewbie in forum New To Java
    Replies: 7
    Last Post: 03-13-2011, 07:45 PM
  2. Audio files.
    By sarah jain in forum Networking
    Replies: 1
    Last Post: 03-11-2011, 05:36 PM
  3. Audio conferencing using JMF
    By sathishkumar in forum Advanced Java
    Replies: 0
    Last Post: 03-10-2011, 03:02 PM
  4. Use stop button to stop moving (stop timers) on JPanel
    By mneskovic in forum New To Java
    Replies: 3
    Last Post: 07-23-2010, 12:50 PM
  5. playing audio in J-App??
    By ashton in forum New To Java
    Replies: 3
    Last Post: 01-30-2009, 08:50 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
  •