Convert a [0,5]V wave to [-2,2]V wave
Place a capacitor in series with your signal to remove the DC offset. Maybe 10µF non-polarised. You can then use a voltage divider (or potentiometer) as an attenuator.







simulate this circuit &ndash; Schematic created using CircuitLab

Note that driving a speaker direct is not recommended (and may not even work properly). Instead you should use some form of power amplifier to provide the current the speaker needs.