internal double GetLoudness() { double loudness; Ebur128Error result = SafeNativeMethods.GetLoudness(_handle, out loudness); if (result != Ebur128Error.Success) { throw new IOException(string.Format(CultureInfo.CurrentCulture, Resources.NativeAnalyzerGetLoudnessError, result)); } return(loudness); }
internal void AddFrames(float[] frames) { Contract.Requires(frames != null); Ebur128Error result = SafeNativeMethods.AddFrames(_handle, frames, new UIntPtr((uint)frames.Length / _channels)); if (result != Ebur128Error.Success) { throw new IOException(string.Format(CultureInfo.CurrentCulture, Resources.NativeAnalyzerAddFramesError, result)); } }
internal double GetLoudnessMultiple() { IntPtr[] handles = _groupState.Handles.ToArray().Select(handle => handle.DangerousGetHandle()).ToArray(); double loudness; Ebur128Error result = SafeNativeMethods.GetLoudnessMultiple(handles, new UIntPtr((uint)handles.Length), out loudness); if (result != Ebur128Error.Success) { throw new IOException(string.Format(CultureInfo.CurrentCulture, Resources.NativeAnalyzerGetLoudnessError, result)); } return(loudness); }
internal double GetSamplePeak() { double combinedPeak = 0; for (uint channel = 0; channel < _channels; channel++) { double channelPeak; Ebur128Error result = SafeNativeMethods.GetSamplePeak(_handle, channel, out channelPeak); if (result != Ebur128Error.Success) { throw new IOException(string.Format(CultureInfo.CurrentCulture, Resources.NativeAnalyzerGetLoudnessError, result)); } combinedPeak = Math.Max(combinedPeak, channelPeak); } return(combinedPeak); }