Does anyone know how to turn the sound off that occurs when the iphone resprings, and the sound when a charging cable is plugged in or unplugged?

I've done this before but for the life of me I can't remember how I did it.

Thanks in advance.