Detect programmatically silent mode

Hi guys,

there is a way with which to detect if the device is in silent mode, mute mode?

is useful because i can alert the user to switch on the audio to listen the audio.

thank you