I've noticed this for a while and it has driven me nuts! Out of nowhere, audio will completely stop working system wide, and until now the only fix I could find was to reboot. It happened on multiple MacBook Pro devices, of multiple generations, and continued across the last few versions of MacOS.
Now, though, it's easily fixable. In terminal, just issue the following command and audio should be back momentarily (if you're having the same issue as me):
In terminal, issue: sudo killall coreaudiod
Enter your password and hit enter