Recording throug Mic or Line_In

How record from Mic or Line In or CDaudio in wav format ?
Please help me out..
Who is Participating?
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.

you can use low level function of MCI.

low level :
waveInOpen etc.

or send mci command string such as
wsprintf(lpstrCommand, "record %s %s %s", lpszDeviceID, lpszRecordFlags,
and then call
MCIERROR mciSendCommand(  MCIDEVICEID IDDevice,    UINT uMsg,            
  DWORD fdwCommand,        DWORD dwParam          );

record through mciWnd is a easy way.
you can create a record window as a child
HWND MCIWndCreate(  HWND hwndParent,        HINSTANCE hInstance,  
  DWORD dwStyle,          LPSTR szFile          );
1. MCIWnd Window Class

Recording with MCIWnd Controls

2. MCI

Recording with a Waveform-Audio Device

3. Waveform Audio

Example of Writing Waveform Data

4. DirectSound

Tutorial 2: Capturing a Sound

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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

The following article talks about Waveform Audio functions.

Recording and Playing Waveform Audio
Shahzad_mcaAuthor Commented:
I'll try this & let you know. U can contact me at
Pl. provide Ur mailId
Shahzad_mcaAuthor Commented:
the Link which U've provided me ,when coded in my appliaction gives lots of error. Can U please provide me with the correct code for recording from Mic/Line_In,Please...
Which link? What error messages?
Shahzad_mcaAuthor Commented:
Now I can Record the sound either through Mic or Line In ,but the problem is that I don't have the control over selection of Mic or Line In.I have to run JukeBox player to assign recording source as Mic or Line In. I wan't to implement it in my application. Is there any ,which can do that...
Yes, you can control it by using Audio Mixers functions. It is a little tough. Take a look at some articles about Audio Mixers at CodeGuru.

Also, check out the Platform SDK sample MixApp.
Shahzad_mcaAuthor Commented:
I'm unable to connect to codeguru I think its dead.Please provide some useful code for it if U can access it.
It was down. Now it is up.
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
System Programming

From novice to tech pro — start learning today.