Processing&Arduino, need change input prom processing to arduino

void keyPressed() {

if(key == 'r')
item.startRecording();

if(key == 's')
item.stopRecording();
}

Here is processing code for start and finish sound recording. How me do it with arduino ?

Well the plain old Arduino has no keypad, so you need to either add one or read input from a serial port. To do the later, you need to use the Serial library like this:

int incomingByte = 0;	// for incoming serial data

void setup() {
	Serial.begin(9600);	// opens serial port, sets data rate to 9600 bps
}

void loop() {

	// send data only when you receive data:
	if (Serial.available() > 0) {
		// read the incoming byte:
		incomingByte = Serial.read();

		// say what you got:
		Serial.print("I received: ");
		Serial.println(incomingByte, DEC);
	}
}