J2ME MMAPI: capture audio in AMR with given bitrate
Colleagues,
I'm facing issue while trying to record audio in AMR. While I successfully record audio in AMR 12.2 kbps I can not change the bitrate. It is always 12.2 kbps regardless of what I specify in media locator string.
Could anybody help me to figure out what parameters should I specify to record audio, for example, in AMR 4.75 kbps?
Thank you in advance.
[388 byte] By [
inventora] at [2007-11-27 6:29:04]

# 2
The code is:
String uri = "capture://audio?encoding=amr&rate=8000&bits=16";
// Get player object
_player = Manager.createPlayer(uri);
_player.realize();
// Get Record Control to be able to record audio
RecordControl rc = (RecordControl)_player.getControl("RecordControl");
// Set destination file
rc.setRecordLocation(rec_file);
// Begin recording from standard input
rc.startRecord();
// Transfer audio from microphone to standard input
_player.start();
Actually AMR bitrate depends on the size of frame which repeats each 20 ms. For 4.75 kbit/s frame is 95 bits long.
I'm not sure how to specify this by 'rate' and 'bits' parameters. I already tried some combinations but in vain. The default for my Motorola Z3 is 12.2 kbit/s. Maybe it even does not support capturing in other bit rates (I'm not sure), though it is able to play AMR files of other bit rates.
Maybe you can point me to the emulator which supports AMR capturing in different bit rates?
Thank you for interest in my question.