I'm writting a code where a client program records sound from the audio input device, sends it to a server and the server analyzes some characteristics of that audio information.

Well, I started using the api mciSendString to record audio and create a *.wav file, but I think that way is quite slow because you've to wait until the recording is ended, send the wav file to the server, etc. So I thought about creating a buffer in the memory and send the audio information in real time to the server so I don't need to create the wave file and I don't need to wait until the recording has ended.

The question is that I don't know what model I should use to do that task. I thought about using wavein apis to perform that task. Is this a correct option or do I should use other technique?