#000655          J2ME MMAPI
#def    ,    MMAPI       J2ME. 
   

 ,    Player,       . 

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

     capture://audio?encoding=amr,            Nokia 6600.      ,   capture://audio   : 

audio_encodings = audio_enc_param *( "&" audio_param )
audio_enc_param = "encoding=" audio_enc
audio_enc = "pcm" / "ulaw" / "gsm" / content_type
audio_param = "rate=" rate /
"bits=" bits /
"channels=" channels /
"endian=" endian /
"signed=" signed /
"type=" audio_type
rate = "96000" / "48000" / "44100" /
"22050" / "16000" / "11025" /
"8000" / other_rate
other_rate = pos_integer
bits = "8" / "16" / "24" / other_bits
other_bits = pos_integer
channels = pos_integer
endian = "little" / "big"
signed = "signed" / "unsigned"
audio_type = bitrate_variable / other_type
other_type = alphanumeric
pos_integer = 1*DIGIT 

:

capture://audio?rate=8000&bits=16
capture://audio?encoding=pcm&signed=unsigned
         ,    .  ,      . 
String[] types= Manager.getSupportedContentTypes("capture");
for( int i= 0; i < types.length; i++ )
someStringItem.setText(errorItem.getText() + " "+types[i]);

      RecordControl.    ByteArayOutputStream,     . 

RecordControl rc = (RecordControl)player.getControl("RecordControl");
ByteArrayOutputStream output = new ByteArrayOutputStream();
rc.setRecordStream(output);
rc.startRecord();
player.start();

     ,    .       ,    ,      .        ,   rc.commit()  . 

Thread.currentThread().sleep(5000);
rc.commit();

      RMS.        ,      ,   . 

byte[] recordedSoundArray = output.toByteArray(); 
 

     : 

ByteArrayInputStream recordedInputStream = new ByteArrayInputStream(recordedSoundArray);
Player p2 = Manager.createPlayer(recordedInputStream,"audio/x-wav");
p2.prefetch();
p2.start();


 ,        ,   MMAPI          (   ).   , ,   Nokia 6600 (Software version 4.09.1)  Siemens S65.     .