# Resistor for buzzer current consumption limiting calculation

I would like to know how did the circuit designer of the circuit in the image calculated resistor R100 value.

My guess is that the 100ohm resistor is to limit the current to ~20mA.

I have tried to figure it out by myself but I'm not sure about it. I would like to know if my calculations are right.

As you can see in the speaker's datasheet the parameters are: $$V_{p-p} = 3V\\I_{max} = 100mA\\R=12\Omega$$ As I know I can treat speaker as resistor put the values to plug in Ohm's law should be RMS. the speaker's voltage is peak-to-peak, so according to the formula below: $$V_{RMS}=0.35355\cdot V_{p-p} = 0.35355\cdot 3 = 1.06V$$ plug it in Ohm's law to calculate the resistor value: $$R_{100} = \frac{3.3V - V_{RMS}}{0.020mA} = \frac{3.3 - 1.06}{0.020} = 100\Omega$$

My calculations are right?