int speakPin = 5; //to speaker wire
int micPin = 6; //to mic wire
int photoPin = 0; //to photo resistor
int pressurePin = 2; //to pressure sensor

int val1 = 0; // this will be a read of the photo resistor
int val2 = 0; // this will be a read of the pressure sensor

// I determined these thresholds after some experimentation looking at the serial monitor; 
// you may need to change them depending on your environment
int photothreshold = 800;
int pressurethreshold = 100;

void setup() {

  Serial.begin(9600);
  pinMode(micPin, OUTPUT);
  pinMode(speakPin, OUTPUT);
// no need to specify for the sensors because analog pins are read as inputs by default
}

void loop() {

  val1 = analogRead(photoPin);
  val2 = analogRead(pressurePin);

  if (val1 < photothreshold) {
    digitalWrite(speakPin, LOW);
    Serial.println("playing");
  } else {
    digitalWrite(speakPin, HIGH);
    Serial.println("not playing");
  }

    if (val2 <= pressurethreshold) {
      digitalWrite(micPin, LOW);
    } else {
      digitalWrite(micPin, HIGH);
    }
  }