My audio devices keep turning off and on
It started as a sign on YouTube. It said, "audio renderer error please restart your computer." And I realized earphones and internal speakers or whatever I use to get audio output get disabled every 10 seconds or so. I searched the error on the internet but all I found was the same complaints from Windows users. Not a single Macbook user had the same problem. I restarted the computer several times, tried plugging different speakers and earphones and made the latest updates again restarting the notebook. Nothing worked so far. On Chrome I cannot open a YouTube video and when I open any file with sound, the sound is off every ten seconds or so, constantly. How can I fix this? Thanks for your help.
I have MacBook Pro (13-inch, Mid 2012). I use macOS Mojave version 10.14.5 (18F132).