×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    8

    Prefetch Error : -5

    hiiii

    i got error prefetch -5 when i'm try to play .wav and .mp3 file in my own player in s60 3rd edition and use content type "audio/x-wav" and "audio/mpeg" respectively.Plz any one tell me reason of this error and solution.i m using simple code for creating player.

    the code is below :-

    public void startApp(){

    InputStream is = getClass().getResourceAsStream("/ash.wav");
    try {
    Player player = Manager.createPlayer(is, "audio/x-wav");
    /* player.realize();
    vc = (VolumeControl) player.getControl("VolumeControl");
    if(vc != null){
    vc.setLevel(Integer.MAX_VALUE);
    }
    player.prefetch();*/
    player.realize();
    player.prefetch();
    player.start();
    } catch (IOException ex) {

    ex.printStackTrace();
    } catch (MediaException ex) {

    ex.printStackTrace();

    }
    }



    i m using netbeans 6.9.1 and s60 3rd edition FP2 SDK
    Last edited by Virus99; 2010-12-13 at 11:04.

  2. #2
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Prefetch Error : -5

    don't do this in the startApp method. you are not allowed to stall the system thread.

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    8

    Re: Prefetch Error : -5

    Quote Originally Posted by njzk2 View Post
    don't do this in the startApp method. you are not allowed to stall the system thread.
    ok i will move this code in side the constructor and try again.

    thanks..

  4. #4
    Registered User
    Join Date
    Dec 2010
    Posts
    8

    Re: Prefetch Error : -5

    Quote Originally Posted by njzk2 View Post
    don't do this in the startApp method. you are not allowed to stall the system thread.
    i was move my code and run again but still i got same error message : -


    javax.microedition.media.MediaException: Prefetch error: -5
    at com.nokia.microedition.media.PlayerImpl.doPrefetch(Unknown Source)
    )
    at com.nokia.microedition.media.PlayerBase.prefetch(Unknown Source)
    at com.nokia.microedition.media.PlayerImpl.start(Unknown Source)
    at check.<init>(Unknown Source)
    at java.lang.Class.newInstanceImpl(Native Method)
    at java.lang.Class.newInstance(Unknown Source)
    at com.symbian.j2me.midp.runtimeV2.Application.constructAction(Application.java:482)
    at com.symbian.j2me.midp.runtimeV2.Application.startRequest(Application.java:427)
    at com.symbian.j2me.midp.runtimeV2.Application.event(Application.java:296)
    at com.symbian.j2me.midp.runtimeV2.ApplicationEvent.dispatch(ApplicationEvent.java:90)
    at com.symbian.j2me.midp.runtimeV2.ApplicationThread.run(ApplicationThread.java:30)
    at com.nokia.microedition.media.SourcePlayer.doPrefetch(Unknown SourceMIDlet: check

  5. #5
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Prefetch Error : -5

    don't do that, the constructor is called in the main thread too.
    open a new thread to play your media

  6. #6
    Registered User
    Join Date
    Dec 2010
    Posts
    8

    Re: Prefetch Error : -5

    Quote Originally Posted by njzk2 View Post
    don't do that, the constructor is called in the main thread too.
    open a new thread to play your media
    ok thanks i got it....

  7. #7
    Registered User
    Join Date
    Nov 2011
    Location
    ahmedabad
    Posts
    32

    Re: Prefetch Error : -5

    Hi,

    Can you give me the example by code.

    thanks
    Jigar

  8. #8
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Prefetch Error : -5

    Hello rathodjigar,

    please note that the discussion took place almost 1,5 year ago, so some of the original participants might not be following this discussion.

    You might want to check Nokia Developer Wiki for MMAPI related code examples: http://www.developer.nokia.com/Commu...MMAPI_(JSR-135)

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  9. #9
    Registered User
    Join Date
    Nov 2011
    Location
    ahmedabad
    Posts
    32

    Re: Prefetch Error : -5

    Hi,

    Will check it.

    Thanks
    Jigar

Similar Threads

  1. prefetch error: -5
    By sepi1982 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2010-12-12, 10:41
  2. Prefetch error -4
    By arungupta_2jan in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2009-02-11, 11:09
  3. Prefetch error -4
    By arungupta_2jan in forum Mobile Java General
    Replies: 1
    Last Post: 2009-02-10, 16:29
  4. Prefetch error - 34
    By redlex in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2007-12-19, 13:12
  5. Prefetch error: -12009
    By baoqho in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2007-11-09, 06:44

Posting Permissions

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