Sometimes this can occur as a race-condition (e.g. the function is not ready by the time it is called). You can avoid this by adding a slight delay to ensure that it is ready by using the setTimeout function :
ScriptManager.RegisterStartupScript(this, GetType(), "PlaySound", "setTimeout(function(){ PlaySound();},10);", true);