예제 #1
0
        private void RaiseDataAvailable(WaveInBuffer buffer)
        {
            var handler = DataAvailable;

            if (handler != null)
            {
                handler(this, new WaveInEventArgs(buffer.Data, buffer.BytesRecorded));
            }
        }
예제 #2
0
        private void CreateBuffers()
        {
            // Default to three buffers of 100ms each
            int bufferSize = BufferMilliseconds * WaveFormat.AverageBytesPerSecond / 1000;

            if (bufferSize % WaveFormat.BlockAlign != 0)
            {
                bufferSize -= bufferSize % WaveFormat.BlockAlign;
            }

            buffers = new WaveInBuffer[NumberOfBuffers];
            for (int n = 0; n < buffers.Length; n++)
            {
                buffers[n] = new WaveInBuffer(waveInHandle, bufferSize);
            }
        }
예제 #3
0
        private void CreateBuffers()
        {
            // Default to three buffers of 100ms each
            int bufferSize = BufferMilliseconds * WaveFormat.AverageBytesPerSecond / 1000;
            if (bufferSize % WaveFormat.BlockAlign != 0)
            {
                bufferSize -= bufferSize % WaveFormat.BlockAlign;
            }

            buffers = new WaveInBuffer[NumberOfBuffers];
            for (int n = 0; n < buffers.Length; n++)
            {
                buffers[n] = new WaveInBuffer(waveInHandle, bufferSize);
            }
        }
예제 #4
0
파일: WaveIn.cs 프로젝트: EnergonV/BestCS
 private void RaiseDataAvailable(WaveInBuffer buffer)
 {
     var handler = DataAvailable;
     if (handler != null)
     {
         handler(this, new WaveInEventArgs(buffer.Data, buffer.BytesRecorded));
     }
 }