Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all
i am trying to develop a window application to record micro phone voice activity.

i am using code below :

C#
[DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
       private static extern int mciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback);


C#
// record from microphone
            mciSendString("open new Type waveaudio Alias recsound", "", 0, 0);
            mciSendString("record recsound", "", 0, 0);



C#
// stop and save
            mciSendString("save recsound c:\\record.wav", "", 0, 0);
            mciSendString("close recsound ", "", 0, 0);
            Computer c = new Computer();
            c.Audio.Stop();




that code save a record.wav file but that file not record conversation on micro phone

please provide me a right solution for that problam

thanx and regards
Sanjay Solanki
Posted
Comments
Abhishek Pant 28-Dec-13 2:46am    
This could help you a little
Recording Sound with a Microphone[^]
BillWoodruff 28-Dec-13 3:19am    
There are articles here on CP about recording: search.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900