public void SetVolume(string parameter)
 {
     if (double.TryParse(parameter, out double volumeLevel))
     {
         if (volumeLevel >= 0 && volumeLevel <= 100)
         {
             if (!MainProgram.testingAction)
             {
                 if (Properties.Settings.Default.UnmuteOnVolumeChange)
                 {
                     try {
                         //Sometimes fails - sentry @833243007
                         AudioManager.SetMasterVolumeMute(false);
                     } catch {
                         MainProgram.DoDebug("Failed to unmute PC. Exception caught.");
                         MainProgram.errorMessage = "Failed to unmute PC";
                     }
                 }
                 try {
                     AudioManager.SetMasterVolume((float)volumeLevel);
                 } catch {
                     //Might not have an audio device...
                     MainProgram.DoDebug("Failed to set PC volume. Exception caught.");
                     MainProgram.errorMessage = "Failed to set PC volume";
                 }
             }
             if (!MainProgram.testingAction)
             {
                 try {
                     if ((int)AudioManager.GetMasterVolume() != (int)volumeLevel)
                     {
                         //Something went wrong... Audio not set to parameter-level
                         MainProgram.DoDebug("ERROR: Volume was not set properly. Master volume is " + AudioManager.GetMasterVolume() + ", not " + volumeLevel);
                         MainProgram.errorMessage = "Something went wrong when setting the volume";
                     }
                     else
                     {
                         successMessage = "Set volume to " + volumeLevel + "%";
                     }
                 } catch {
                     MainProgram.errorMessage = "Failed to check volume";
                 }
             }
             else
             {
                 successMessage = "Simulated setting system volume to " + volumeLevel + "%";
             }
         }
         else
         {
             MainProgram.DoDebug("ERROR: Parameter is an invalid number, range; 0-100 (" + volumeLevel + ")");
             MainProgram.errorMessage = "Can't set volume to " + volumeLevel + "%, has to be a number from 0-100";
         }
     }
     else
     {
         MainProgram.DoDebug("ERROR: Parameter (" + parameter + ") not convertable to double");
         MainProgram.errorMessage = "Not a valid parameter (has to be a number)";
     }
 }