Read sound-frequency from 3.5mm jack ?

The positive terminal of the op-amp (pin 3) is set to 1.25V by the voltage divider R2 and R3. By negative feedback, the negative terminal (pin 2) is kept to the same voltage. Now R1 and R4 form a voltage divider:

1.25V = (Vout - Vin)*R1/(R1+R4) + Vin

When Vin is 0:

1.25V = VoutR1/(R1+R4) = Vout30k/(30k+30k) = 0.5Vout

so Vout = 1.25V/0.5 = 2.5V.

So it's not that the circuit offsets the input to 2.5V. It's that when the input is 0V, the output is 2.5V. When the input goes higher, the output goes below 2.5V, and when the input goes negative the output goes above 2.5V.

--
The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected