Hi,
I am trying to build a sound recording application on Series 60 2nd Edition platform using J2ME.
Following is a snippet of my code for the same:
//Imports Section
import java.io.IOException;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.media.*;
import javax.microedition.media.Control.*;
import com.nokia.microedition.media.control.RecordControl;
//Method to start recording
public void StartRecording()
{
try
{
//Create a player
Player p = Manager.createPlayer("capture://audio");
p.realize();
//Get RecordControl, Set RecordLocation and Record for 5 secs
RecordControl rc=(RecordControl)p.getControl("RecordControl");
rc.setRecordLocation("file:/tmp/audio.wav");
rc.startRecord();
p.start();
Thread.currentThread().sleep(5000);
p.stop();
rc.stopRecord();
rc.commit();
}
catch(Exception ex)
{
Form frm3=new Form("Record Error");
frm3.append(ex.getMessage());
Display.getDisplay(this).setCurrent(frm3);
}
}
I have referred the example given in the forum, but when i run it in the emulator it gives me the "Could not create Player" error.
I am pretty new to development on this platform. Can someone please guide me here.
Thanks,
Saket

Reply With Quote

