Wait until Safari stops playing audio

Hy,
is it possible to wait until Safari has played an audio file?
If Safari plays audio, there is this little blue speaker. I tried to make a macro running when this speaker icon is not visible anymore. But that did not work. KM could not find this image.
Thanks a lot for your help.
Kind Regards

Can you share what you got so far