WIN API Multimedia functions

I have written a program using Windows Multimedia API to record voice from the microphone and store this recorded data in a fixed amount buffer. When the buffer is filled, retrieve the data from the buffer and output to the PC speakers. The microphone and the speakers are connected to the soundcard of the PC.

How to I write the program to input and output the voice signal using Windows Multimedia API in realtime?

I am using a full duplex sound card.
Who is Participating?
sun307Connect With a Mentor Commented:
Hi !
I too have developed the same application in VC++ SDK and it is working fine over the internet.

To send the voice in realtime you have to create an array of size around 4 of the structure in which you are recording the voice so that you can record voice in small chunks of the order of 0.5 seconds. Then send this array of data to the soundcard. when one object is got filled with sound data the window will receive a message WOM_DONE. Process that in the time the another structure is filled. In the processing i mean to say that send this small amount of data over the net to another computer, unprepare the first buffer, send it back to the soundcard and wait for the another one. This cycle will go on in a loop. Same have to be done for the voice that yopu are receiving.

Remember to use threads for this application. One for receiving and playing the voice you are receiving and another for recording and sending the voice.

I hope that you are waveInxxx and waveOutxxx functions for recording and playing the voice.

To get more clarification write back

Best of luck
Your sound card needs to be a duplex sound card in order to play and record at the same time.
VolverineAuthor Commented:
Edited text of question.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

VolverineAuthor Commented:
Thank you sun307 for the information. Yes, I am using wave functions. I have already done the things sun307 has mentioned except the threading part. I know I have to use multi-threading, but am not sure of how to do it.

I hope sun307 can send me the project of the similar application to me.
VolverineAuthor Commented:
Hi sun307,

I believe my solution to accomplish realtime is to use multi-threading. I hope you can help me on how to go about with it. And also, anyone else can also help me at the following email address : <>

sun307 , can you email to me the project in which you said it is similar to what I want to accomplish.

Thank you and hope to hear from you soon.  
There used to be a sample program at Creative developer Web site. Unfortunately, it has been removed (or moved).
Hi volverine !
the project that i had made can be found at the following URL :

you can download this application, run it and see if it is of the kind you are trying for.

Send me more details like :
CODECS you wish to implement.
Whether u r using MFC or SDK
What you have done till now etc.

Without threads the application will run on LAN very well. So Is your application is currently running on LAN without thread and codecs

My email id is
I can't open the URL.
I need it too. May I have it?
Hi daitt!
Do u want the application or source code ???
If you wish to se the application, then i can send it to you.
My email id is :
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.