You Are Here:

Community: Developer Discussion Boards

#1 Old capture amr in 3230 - 2006-11-07, 13:01

Join Date: Oct 2006
Posts: 11
kamanashisroy
Offline
Registered User
Hi,

I am new in J2me. I am interested in the advanced features in my s60 mobile(model 3230). I am trying to capture audio in amr encoding. I read the related topics and wrote the following method.

Player recorder;

.... ....
.... ....

public void setUpMedia() {
debug("SDPIntegrator:setUpSend(): >>>> Capture device setup >>>> ");
try {
if (recorder == null || recorder.getState() == Player.CLOSED) {
// Create new instance of recorder
recorder = javax.microedition.media.Manager
.createPlayer("capture://audio?encoding=amr");
debug("SDPIntegrator:setUpSend():Recorder created");
} else {
// Reuse the recorder
recorder.deallocate();
debug("SDPIntegrator:setUpSend():Recorder deallocated");
}
recorder.realize();
debug("SDPIntegrator:setUpSend():Recorder realized");
RecordControl rc = (RecordControl) recorder
.getControl("RecordControl");
debug("SDPIntegrator:setUpSend():Audio Input Format : "+rc.getContentType());
rc.setRecordStream(new ByteArrayOutputStream());
debug("SDPIntegrator:setUpSend():RecordControler stream is set");
rc.startRecord();
debug("SDPIntegrator:setUpSend():RecordControler started");
debug("SDPIntegrator:setUpSend():Starting Recorder while in state ("+( (recorder.getState() == Player.REALIZED)?"Realized":"Not Realized" ) +")");
recorder.start();
debug("SDPIntegrator:setUpSend():Recorder started");
debug("SDPIntegrator:setUpSend():**** Waiting ************");
try {
Thread.sleep(20000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
debug("SDPIntegrator:setUpSend():**** Stopping ************");
recorder.stop();
debug("SDPIntegrator:setUpSend():Recorder stop");
rc.stopRecord();
debug("SDPIntegrator:setUpSend():RecorderControl stop");
rc.commit();
debug("SDPIntegrator:setUpSend():RecorderControl commit");
recorder.close();
debug("SDPIntegrator:setUpSend():Recorder close");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
debug("SDPIntegrator:setUpSend():IOE:"+e.getMessage());
} catch (MediaException e) {
// TODO Auto-generated catch block
e.printStackTrace();
debug("SDPIntegrator:setUpSend():ME:"+e.getMessage());
} catch (IllegalStateException e) {
e.printStackTrace();
debug("SDPIntegrator:setUpSend():IS:"+e.getMessage());
}
}
.........
.........

Problem is after realization , when I used,
recorder.start();
I see SymbianOS Error -1

When I use audio/wav in place of audio/amr , the recorder starts and works fine.
So what is the problem ? where am I doing wrong ?
Reply With Quote

#2 Old Re: capture amr in 3230 - 2006-11-07, 18:28

Join Date: Apr 2003
Posts: 6,408
Location: USA, CA
hartti's Avatar
hartti
Offline
Nokia Expert
Symbian Error Codes are listed for example here
http://www.newlc.com/Symbian-OS-Error-Codes.html

"KErrNotFound -1 Unable to find the specified object "

I have not tested this and I do not have documentation in front of me right now, but looks like the amr recording is not supported on 3230

Hartti
Reply With Quote

#3 Old Re: capture amr in 3230 - 2006-11-08, 00:09

Join Date: Oct 2006
Posts: 11
kamanashisroy
Offline
Registered User
hi Hartti,

Thanks for reply.

Now, I have found audio recording in 3230 is supported according to the audio/vedio capability table in,
http://forum.nokia.com/main/resource...deo/index.html

Moreover, There are applications( may be builtin or may be not java application) that can record audio as amr file.

Again, the player is able to realize(). If the encoding were not supported the createPlayer() would create an exception like "amr encoding is not supported". The problem is when it starts. Note that I did not use prefetch() while my first post. When I used prefetch(), I found the player could not prefetch too(with the same exception).

So, please tell me if there is any solution for this. Another thing I want to know is that if there is any ways to set the amr mode ( I mean like &mode=0 ) because there are several modes of amr encoding available.

Thanks again,
Kamanashis Roy
Last edited by kamanashisroy : 2006-11-08 at 12:48.
Reply With Quote

#4 Old Re: capture amr in 3230 - 2006-11-08, 02:24

Join Date: Apr 2003
Posts: 6,408
Location: USA, CA
hartti's Avatar
hartti
Offline
Nokia Expert
Kamanashis, note that many times the Java implementation on a device does not support all of the formats what the native platform supports.

If the midlet works with wav and fails with amr, the logical explanation is that amr is not supported through Java.

I have not tested this myself. Unfortunately also the MIDP MMAPI support document on our site does not give definite answer to this question.

Hartti
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
Similar Threads
Thread Thread Starter Forum Replies Last Post
Playing AMR file is solved, Here is the solution. khurshed79 Symbian Media (Graphics & Sounds) 8 2007-12-19 07:11
A easy way to convert PCM to AMR or vice versa in Series 60 SDK 2.x lighthu Symbian Media (Graphics & Sounds) 52 2006-10-31 15:05
AMR tp PCM using CMMFCodec on Symbian 8.0 (6630) stew_mclean Symbian Media (Graphics & Sounds) 2 2005-12-15 06:53
amr on sdk 2.1 cedricaudru General Symbian C++ 0 2004-08-23 12:03
AMR samples hayalet General Messaging 0 2002-11-13 19:58

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