internal NativeR128Analyzer(uint channels, uint sampleRate, GroupToken groupToken) { Contract.Requires(channels > 0); Contract.Requires(groupToken != null); Contract.Ensures(_channels == channels); Contract.Ensures(_groupToken == groupToken); Contract.Ensures(_handle != null); Contract.Ensures(!_handle.IsInvalid); Contract.Ensures(_groupState != null); _channels = channels; _groupToken = groupToken; _handle = SafeNativeMethods.Initialize(channels, sampleRate, Mode.Global | Mode.SamplePeak); _groupState = _globalHandles.GetOrAdd(groupToken, new NativeR128GroupState()); _groupState.Handles.Add(_handle); }
internal static extern Ebur128Error GetLoudness(NativeStateHandle handle, out double result);
internal static extern Ebur128Error GetSamplePeak(NativeStateHandle handle, uint channel, out double result);
internal static extern Ebur128Error AddFrames(NativeStateHandle handle, float[] source, UIntPtr count);