This was happening since Sierra for me and it's still here now on Mojave. Every time, when closing my macbook over night (just switch user to login screen, no logout or shutdown), if I don't quit Safari, the next day when I login the audio is completely silent in Safari. The system audio is still working and songs in Finder/iTunes play normally, but not Safari.
But the really annoying part is that the only way (I found to work) to get the sound back was to restart the whole system. Restarting just Safari did nothing, logout/login did nothing, killall Safari nothing, etc.
Does this happen to anyone else too? Do you know of any way to fix the sound, other than rebooting the computer? Thanks!