Audio Capture only happens if its more than 5 seconds

Hello,

I'm writing a midlet that does audio capture on the LG CU500 phone. When I capture for 5 seconds or more, audio capture works as intended, however if I only record for under 5 seconds, it doesn't work. There is no timer. Would could be causing the problem?

Thanks

aztec30

[305 byte] By [aztec30a] at [2007-10-3 4:50:55]
# 1
I also noticed that say I record 10 seconds, the last 3 seconds (give or take) are chopped off. I only hear the recording for the first 6-7 seconds.
aztec30a at 2007-7-14 22:55:34 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

Here is a snippet of the code that i'm using. When playing back, if I record say 10 seconds, I only hear about 7 seconds of the recording. About 3 seconds are cut off at the end. If I record for say less than 4 seconds, nothing seems to be recorded, nothing plays back.

To record I do the following

try {

if(player != null)

player.stop();

if(ctrl != null)

ctrl.commit();

player.deallocate();

player.close();

ThreadSleep(500);

if (player==null) {

player = Manager.createPlayer("capture://audio?encoding=audio/amr");

}

player.realize();

player.prefetch();

player.addPlayerListener(playerListener);

is = new ByteArrayOutputStream();

ctrl = (RecordControl)player.getControl("RecordControl");

ctrl.setRecordStream(is);

ctrl.startRecord();

player.start();

} catch (Throwable e) {

Once recording is stopped I do this

try {

player.stop();

ctrl.commit();

player.deallocate();

player.close();

Thread.sleep(500);

if (is !=null) {

playback= Manager.createPlayer(new ByteArrayInputStream(is.toByteArray()),

"audio/amr");

playback.addPlayerListener(playerListener);

playback.start();

}

} catch (Throwable e) {

aztec30a at 2007-7-14 22:55:34 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3
Can you capture images at all? Audio gives a recording error when I try it, but image says "Failed to Realize".
mts7777777a at 2007-7-14 22:55:34 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4
I haven't tried to capture and image, only audio.From my experince it will fail to realize if you don't have the right mime type.
aztec30a at 2007-7-14 22:55:34 > top of Java-index,Java Mobility Forums,Java ME Technologies...