Beispiel #1
0
        private int FillBuffer(AudioBuffer audioBuffer)
        {
            int bytes;
            int totalBytes = 0;
            int length = buffer.Length;

            while (totalBytes < length && (bytes = stream.Read(buffer, totalBytes, length - totalBytes)) > 0)
                totalBytes += bytes;

            audioBuffer.BufferData(stream.Format, stream.Frequency, buffer, totalBytes);

            return totalBytes;
        }
Beispiel #2
0
 public void CaptureSamples(AudioBuffer buffer, int sampleCount)
 {
     buffer.BufferData(format, frequency, CaptureSamples(sampleCount));
 }