You Are Here:

Community: Developer Discussion Boards

#1 Old javax.microedition.media.Mediaexception:Deviceerror - 2008-10-12, 08:49

Join Date: Oct 2008
Posts: 8
gupta.akhil21
Offline
Registered User
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.Mediaexception:Deviceerror. The program is running fine on emulator. I am using content type as audio/x-amr.Could anybody suggest any way????

Thanks
Akhil
Reply With Quote

#2 Old Re: javax.microedition.media.Mediaexception:Deviceerror - 2008-10-12, 09:03

Join Date: Apr 2003
Posts: 6,408
Location: USA, CA
hartti's Avatar
hartti
Offline
Nokia Expert
Are you stopping the other players before trying to playback the recording?
http://www.forum.nokia.com/document/...8E867E73B.html

Hartti
Reply With Quote

#3 Old Re: javax.microedition.media.Mediaexception:Deviceerror - 2008-10-12, 09:19

Join Date: Oct 2008
Posts: 8
gupta.akhil21
Offline
Registered User
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);
}
}
Reply With Quote

#4 Old Re: javax.microedition.media.Mediaexception:Deviceerror - 2008-10-13, 07:58

Join Date: Apr 2003
Posts: 6,408
Location: USA, CA
hartti's Avatar
hartti
Offline
Nokia Expert
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
Reply With Quote

#5 Old Re: javax.microedition.media.Mediaexception:Deviceerror - 2008-10-14, 18:12

Join Date: Oct 2008
Posts: 8
gupta.akhil21
Offline
Registered User
I have tried using both but nothing is working. It is giving same error in both.

Akhil
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia