/// <summary> /// Calculate the root mean square of the audio. /// </summary> /// <returns>The RMS value</returns> private double CalculateRms() { Sanity.Requires(ParseDataFlag, "The wave data has to be parsed in order to get RMS."); return(Math.Sqrt(DataValues.Sum(x => x * x) / DataValues.Length)); }