Sound is generated on Samsung Mobile device during shaking
The sound is due to the Camera Lens Barrel required to operate the Auto Focus function.
If your device supports an Auto Focus function, the Camera module lens unit will be suspended over the image sensor. The auto focus adjusts by moving the lens unit up and down over the image sensor. This helps the Auto Focus speed and accuracy and also reduces battery usage.
The camera module is fitted with a 'Stopper' to limit the lens movement within the camera module - when the lens and stopper touch (by shaking your device) a noise may occur. This is a normal operation of the camera. The sound made may differ slightly by device types and model.
Note: This article focus only on Samsung newer mobile device models like S8 | S8+ | Note8 | S9/S9+ | Note9 | S10 | S10+ | S10e