The RIM API contains the JSR 135 Java Mobile Media API for processing audio and video content.
You are fixing a clutter in the BB knowledge base. The only way is to view it, hoping that they will no longer change the site map.
This is Developers-> Resources β Knowledge Base β Java API & Samples β Audio and Video
Audio recording
Basically, it's just for recording sound:
- create a player with the right sound encoding
- get RecordControl
- start recording
- stop recording
:
RIM 4.6.0 API ref: javax.microedition.media
BlackBerry
How To -
How To -
How To -
How To -
-
Media.
Player, RecordControl :
final class VoiceNotesRecorderThread extends Thread{
private Player _player;
private RecordControl _rcontrol;
private ByteArrayOutputStream _output;
private byte _data[];
VoiceNotesRecorderThread() {}
private int getSize(){
return (_output != null ? _output.size() : 0);
}
private byte[] getVoiceNote(){
return _data;
}
}
Thread.run() :
public void run() {
try {
_player = Manager.createPlayer("capture://audio");
_player.realize();
_rcontrol = (RecordControl)_player.getControl("RecordControl");
_output = new ByteArrayOutputStream();
_rcontrol.setRecordStream(_output);
_rcontrol.startRecord();
_player.start();
} catch (final Exception e) {
UiApplication.getUiApplication().invokeAndWait(new Runnable() {
public void run() {
Dialog.inform(e.toString());
}
});
}
}
thread.stop():
public void stop() {
try {
_rcontrol.commit();
_data = _output.toByteArray();
_output.close();
_player.close();
} catch (Exception e) {
synchronized (UiApplication.getEventLock()) {
Dialog.inform(e.toString());
}
}
}
, . .
, . . , :
:
java.net: Java ME Vikram Goyal