There is an analogwrite command which you can use with certain digital pins, but it doesn't output different voltages. It turns the pin on and off really fast, leaving it off longer for lower values. This is called pulse width modulation, or PWM. PWM will let you do certain things like dim an LED, but it won't let you play back sound on a piezo speaker.

But to answer your question about different voltages from the analog pins... no. To output different voltages you'd need a DAC IC, or you'd have to wire a bunch of pins together in what is known as a resistor ladder.