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]

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) {