Blocking DC when driving a buzzer with a PWM signal
A capacitor blocks DC and passes AC broadly speaking. maybe try a 10 uF capacitor. At 100 Hz it will have an AC impedance of 159 ohms. At 1 kHz it will be 15.9 ohms. Here's how: -



Your piezo load is the resistor in the above.