Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: 17640 buffer size

$
0
0
right now I am getting 17640 samples from this code
 void waveIn_DataAvailable(object sender, WaveInEventArgs e)
        {

            byte[] buffer = e.Buffer;
            int bytesRecorded = e.BytesRecorded;
            buffer1 = new float[bytesRecorded];
            //  WriteToFile(buffer, bytesRecorded);

            for (int index = 0; index < e.BytesRecorded; index += 2)
            {
                short sample = (short)((buffer[index + 1] << 8) |
                                        buffer[index + 0]);
                float sample32 = sample / 32768f;
                buffer1[index] = sample32;
            }
I need to get 2^X samples at a time without losing any samples
so 2^14 is 16384... how can i get 16384 samples at a time with out losing any data?
I just want to take 16384 and run it in to a DSP and then move to the next 16384 samples with out losing any sound data... can this be done?

Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>