How to make sense of the raw audio data coming in from Wavelib.fifostream

I have created a VB application (powerpoint Addin) in Visual Studio 2013 which controls lights etc in my house via interfacing to NCD relay controller. I had the idea to try and have a sort of disco option, where the program listens to the input coming in from the PC microphone and (based on user set parameters) uses volume based triggers to initiate changes in the relays, thus creating the switching of lights on or off to create the disco effect.

I managed to get the microphone data coming into the application (and I know it is correct since I can play it direct out to the default speaker and I get the  microphone sounds coming out on the speaker - ok with a vary slight delay). Now what I want to do is convert the raw data into a snap-shot amplitude for a specific range of frequencies (show it on a sort of progress bar to start with and make it more fancy later on), but I am stuck trying to understand and convert the raw data - despite reading many articles on the www....

This part of the app is written in c#. The relevant code extracts are:

                WaveLib.WaveFormat fmt = new WaveLib.WaveFormat(44100, 16, 2);
- so I am requesting sample rate of 44100 hz, 16 bit and stereo from the microphone....  (Maybe a bit optimistic?)

I receive the data in a buffer which is defined on global level within the class
        private byte[] RecBuffer;

So I have an 8bit buffer, receiving 16bit stereo, so I have understood (maybe incorrectly)
- RecBuffer[0]*256 + recBuffer[1]   gives me the left channel and
- RecBuffer[2]*256 + recBuffer[3]   gives me the right channel
and this is repeated the length of the buffer, but my question is how do I make sense of this data and how can I understand the amplitude and frequency ?  Can anyone point me in the right direction .... help would be much appreciated.....   thanks....
KeithD2Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KeithD2Author Commented:
Thanks. The first one helped great......
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.