using System;
using System.Linq;
// ReSharper disable once CheckNamespace
namespace NAudio.Wave
{
///
/// Silence producing wave provider
/// Useful for playing silence when doing a WASAPI Loopback Capture
///
public class SilenceProvider : IWaveProvider
{
///
/// Creates a new silence producing wave provider
///
/// Desired WaveFormat (should be PCM / IEE float
public SilenceProvider(WaveFormat wf) { WaveFormat = wf; }
///
/// Read silence from into the buffer
///
public int Read(byte[] buffer, int offset, int count)
{
Array.Clear(buffer, offset, count);
return count;
}
///
/// WaveFormat of this silence producing wave provider
///
public WaveFormat WaveFormat { get; private set; }
}
}