This project has moved and is read-only. For the latest updates, please go here.

How can i save the captured sound into an array

Jun 28, 2016 at 2:20 PM
Hi there,
I am new to C# and naudio. Currently i want to build a signal processing program. The capture frequency is 8K Hz.
Is there any way to capture the sound and store it in an array?
Any one can show me a sample of capturing the first 8000 samples and store it in an int array?
Sep 22, 2016 at 7:28 PM
You can use WaveIn to record audio. In the DataAvailable event handler you'd get the captured audio in a byte array. I'd recommend writing audio to a MemoryStream as you get it and then later you can read out of that memory stream, converting each pair of bytes into a short (assuming you recorded at 16 bit)