예제 #1
0
 /// <summary>
 /// Initializes a new WaveOutProvider class.
 /// </summary>
 public WaveOutAudioProvider()
 {
     var devices = WaveOut.GetDevices();
     if (devices.Length == 0) throw new AudioException("No available audio devices where found.");
     _device = 0;
     _waveOut = new WaveOut();
     _waveOut.PlaybackChanged += PlaybackChangedEvent;
 }
예제 #2
0
        /// <summary>
        /// Initializes a new WaveOutBuffer class.
        /// </summary>
        /// <param name="waveOut">The WaveOut.</param>
        /// <param name="bufferSize">The BufferSize.</param>
        public WaveOutBuffer(WaveOut waveOut, int bufferSize)
        {
            if (waveOut == null)
                throw new ArgumentNullException("waveOut");
            if (bufferSize <= 0)
                throw new ArgumentOutOfRangeException("bufferSize");

            _waveOut = waveOut;
            _bufferSize = bufferSize;
        }