Hi triple177,
Thank you for using the Apple Support Communities! I understand you are hearing an unexpected sound from your MacBook speaker while playing videos. I'd like to explore this further.
-Are you hearing this only when you have your volume at a higher level?
-Is this happening with all audio sources, or only when playing YouTube videos?
-Do you have any additional peripherals connected to your MacBook?
-If you were to connect a set of headphones to your MacBook (if available), do you hear that same sound?
I'd like to have you reset the NVRAM/PRAM on your Mac following these steps Reset NVRAM or PRAM on your Mac - Apple Support, as it helps troubleshooting sound issues.
If the issue remains, test a new user account next, to isolate if this is a user-specific issue, or a system-wide issue. Here’s how: How to test an issue in another user account on your Mac - Apple Support. Based on the results in the new user, you could continue to the section titled 'If the issue doesn't happen in the other account' or 'If the issue happens in the other account' to continue troubleshooting.
Keep me posted.
Regards.