Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2011

    Stop and Replay audio

    public void playMP3() {
    try {
    InputStream is = getClass().getResourceAsStream("/rr.mp3");
    if (p == null) p = Manager.createPlayer(is, "audio/mp3");
    VolumeControl vc = (VolumeControl)p.getControl("VolumeControl");
    if(vc != null)
    // vc = (VolumeControl)p.getControl("VolumeControl");
    } catch (IOException ioe) {
    this.showError("IOException", ioe.getMessage());
    } catch (MediaException me) {
    this.showError("MediaException", me.getMessage());

    I am using this code snippet for playing audio files.
    In my app I need to stop and replay the file from starting.By using p.stop() and recalling the above function the files is playing from the position where it is stopped.
    Please suggest me any solution.

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    The Capital of INDIA

    Re: Stop and Replay audio

    Try to call the player's deallocate() method and test. You need to free all the resources that the player has acquired. Player's close() method can help you too.
    Thanks with Regards,

    R a j - The K e r n e l

    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Mar 2011

    Re: Stop and Replay audio

    thnax deallocate() methods is working.

Similar Threads

  1. Streaming problem: Audio stop before playing
    By unidentify in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2009-12-08, 11:27
  2. How to stop audio player?
    By ManuMies in forum Symbian
    Replies: 7
    Last Post: 2008-09-02, 03:01
  3. How To Stop And Pause Audio File In Midlet
    By mathi77in in forum Mobile Java General
    Replies: 1
    Last Post: 2005-07-18, 15:04
  4. How to stop audio streaming on an incoming call?
    By lalitsharma in forum Symbian
    Replies: 0
    Last Post: 2005-06-02, 06:29
  5. Stop audio playing
    By walterzcm in forum Mobile Java General
    Replies: 0
    Last Post: 2002-12-03, 03:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts