What's the basic process of capturing audio?

John Zukowski


// Get the player
Player player = Manager.createPlayer("capture://audio");

// Realize it
player.realize()

// Get the RecordControl
RecordControl control = (RecordControl)capturePlayer.getControl(
  "javax.microedition.media.control.RecordControl");

// Set location
control.setRecordLocation("file:///location.wav");

// Start player
player.start();

// Start recording
control.startRecord();

// wait until done
... in another thread or in response to action/timeout...

// Stop recording
control.stopRecord();

// Commit recording
control.commit();

// Stop player
player.stop();

// Close player
player.close();

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact