(Some instructions taken from MrTony and maerlim.)
You'll need the Android SDK (
guide to download and install is here)
You'll need root accesss
You'll need the drivers for your device
You'll need Busybox (available on the market after you root the phone)
First, create the new file you would like to use as your sound. You need to have the file format be .ogg, because this file is going to replace the system file in your phone and it has to have the same name. (I used
this free mp3/wma/ogg converter to convert a .wav file into .ogg.)
After you have created your .ogg file, rename it to Charger_Connection.ogg and place it in the <your Android SDK install directory>/tools folder.
Then, follow these instructions:
Connect USB to phone with USB Debugging ON (Menu -> Settings -> Applications -> Development -> USB debugging)
Open a Windows Command prompt in the Android SDK install directory
cd tools
adb push Charger_Connection.ogg /sdcard
adb shell
su
cp /system/media/audio/ui/Charger_Connection.ogg /sdcard/Charger_Connection.ogg.bak
cp /sdcard/Charger_Connection.ogg /system/media/audio/ui/Charger_Connection.ogg
exit
exit
You can also do this to change other system audio files, like low battery (TW_Low_Battery.ogg), camera click (camera_click_short.ogg), unlocking the phone (TW_Unlock.ogg), etc.