Beep Sound

I want to make a beep sound with arduino that sounds like the heart monitors at hospitals. I have this code but i dont know what i need to change to make it sound like that.

int speaker = 4;

void setup() {
  pinMode(speaker, OUTPUT);
}

void loop() {
  for (int i=0; i<30; i++) {
    digitalWrite(speaker, HIGH);
    delayMicroseconds(1000);
    digitalWrite(speaker, LOW);
    delayMicroseconds(1000);
  }
  delay(1800);
}

Here example sound: - YouTube

THX in advance!

http://forum.arduino.cc/index.php?topic=142097.0;topicseen

Frequency of beep, length of beep, and time between beeps. It's then just a loop.

Tim

toneAC seems great, i will test it out! thx