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

solved: Getting the input level

Feb 21, 2010 at 7:14 AM
Edited Feb 23, 2010 at 1:35 AM

Hey, I ve been playing around with this set of libraries and cant figure out how to get the input level coming in from the sound card.  Ive set up the WaveIn properly (I hope) and cant seem to find how to get the input level.

Im a complete noob in programing and am just playing around to see what it can do. 


Thanks John


NVM I figured it out



        void waveIn_DataAvailable(object sender, WaveInEventArgs e)
            byte[] buffer = e.Buffer;
            int bytesRecorded = e.BytesRecorded;
            label11.Text = (sample32.ToString());
            volumeMeter1.Amplitude = sample32;
            for (int index = 0; index < e.BytesRecorded; index += 2)
                short sample = (short)((e.Buffer[index + 1] << 8) | e.Buffer[index + 0]);
                sample32 = sample / 32768f;  
            label12.Text = (buffer.ToString());