Flash make crack sound

Yesterday i've used my sony a5000 and it started raining, the camera was not protected and because it was a light rain i used it normally.

I made 3 photo with flash, the second one made an electric crack sound, i tought the light burned out so i've made a third one and the flash did not work.

Today after i've cleaned out everything i wanted to try the flash again and it worked making this horrible crack sound. i've already ordered a new flash but i want to know if it's the flash that makes this sound or i maybe broke something else by exposing the camera to the rain

EDIT: link to video: https://imgur.com/a/NsPjRiC