Controlling audio in safari

So this is probably my first attempt at “programming” anything in 10 or 15 years, I have a script that is largely complete as a routine to assist in daily tasks that I repeat often. One feature I would like to add is the ability to mute and playing tabs in safari. Does anyone know how this might be possible?