Playing hit sound on the server

If you really want the hit sound, but it doesn’t play in the browser for any reason (or if you don’t want to keep the tab open all the time) you can play it on the server by adding this at the end of the config.

IF STRINGKEY @data.STATUS EqualTo "SUCCESS"
using System.Media.SoundPlayer myPlayer = new System.Media.SoundPlayer();
myPlayer.SoundLocation = @"wwwroot/sounds/hit.wav";
myPlayer.Play();
END

Note: this snippet is only valid for the web version, for the native version you have to change the sound location to something like Sounds/hit.wav (I didn’t test it)

8 Likes