Embedded Designers does not like much making Tones or Alarms.
If I need a small sound with a piezo I'll write a small loop program (Using delays) to on & off a particular pin.
If I need an alarm to a factory I would simply operate a relay & connect an external alarm to it.
I'm with Gayan here--save your cycles for something more important, and use one pin to trigger a transistor to turn on a buzzer instead of modulating a piezo or speaker.