I used this when I was playing around with it, years ago.
#include <GuiButton.au3>
$mute = GUICtrlCreateButton("Mute", 30, 30, 30, 30)
_ToggleMute()
Func _ToggleMute()
$readButton = _GUICtrlButton_GetText($mute)
If $readButton = "Mute" Then
SoundSetWaveVolume(0)
_GUICtrlButton_SetText($mute, "Unmute")
Else
_GUICtrlButton_SetText($mute, "Mute")
SoundSetWaveVolume(100)
EndIf
EndFunc