Can I use "currently rendering" as a driver input?

I want to have an audio track muted when I play the animation within Blender, but not when I render the actual video file. I figure I could do this using a driver to mute/unmute the audio. Is there any variable I could use as input that tells whether it’s in “render” mode or “viewport” mode?