What type of capacitor do I need to stabilize USB voltage?
It’s very likely your speaker is drawing more current from the USB port than the R-pi can deliver. The port current limiter is kicking in, momentarily powering down the port. You will not be able to fix that by adding caps.

Instead, you can increase this USB power limit in software, by changing /boot/config.txt. More here: https://hackaday.com/2015/04/06/more-power-for-raspberry-pi-usb-ports/