×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    8

    javax.microedition.media.Mediaexception:Deviceerror

    I am working on nokia 3110 handset. I am trying make application to to record and play sound. I am successfully recording the sound but while playing recorded sound it is giving javax.microedition.media.Mediaexceptioneviceerror. The program is running fine on emulator. I am using content type as audio/x-amr.Could anybody suggest any way????

    Thanks
    Akhil

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: javax.microedition.media.Mediaexception:Deviceerror

    Are you stopping the other players before trying to playback the recording?
    http://www.forum.nokia.com/document/...8E867E73B.html

    Hartti

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    8

    Re: javax.microedition.media.Mediaexception:Deviceerror

    yes I am stopping the player which is doing recording before calling playback facility I am also enclosing my code.


    private void recordtofile()
    {
    try{
    store = RecordStore.openRecordStore("voicestore",true);
    p= Manager.createPlayer("capture://audio");
    p.realize();
    rc = (RecordControl)p.getControl("RecordControl");
    output = new ByteArrayOutputStream();
    rc.setRecordStream(output);
    rc.startRecord();
    p.start();
    Thread.currentThread().sleep(10000);
    p.stop();
    rc.stopRecord();
    rc.commit();
    byte[] b = output.toByteArray();
    store.addRecord(b,0,b.length);
    InputStream is = new ByteArrayInputStream(b);
    player = Manager.createPlayer(is, "audio/x-wav");
    player.prefetch();
    player.start();
    mDisplay.setCurrent(mMainScreen);
    }
    catch(Exception e)
    {showException(e);
    }
    }

  4. #4
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: javax.microedition.media.Mediaexception:Deviceerror

    your code says that you try to playback x-wav but you say in your first post that you are using x-amr? Which one you really recording?

    Hartti

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    8

    Re: javax.microedition.media.Mediaexception:Deviceerror

    I have tried using both but nothing is working. It is giving same error in both.

    Akhil

Posting Permissions

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