ammusekar
May 30th, 2008, 01:08 AM
Hi..I want to record the wave files and want to store it in the specified location ,in which the user types the File Name in a TextBox.Im using the following code
to record & save.
[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);
private void btnrec_Click(object sender, EventArgs e)
{
mciSendString("open new Type waveaudio Alias recsound", null, 0,0);
mciSendString("record recsound","", 0, 0);
}
private void btnsave_Click(object sender, EventArgs e)
{
mciSendString("save recsound C://recordnew.wav","", 0, 0);
mciSendString("close recsound ","", 0, 0);
Computer c = new Computer();
timer1.Stop();
c.Audio.Stop();
}
I Tried to append via stringBuilder as
StringBuilder sb = new StringBuilder();
sb.Append("C://recordnew.wav");
mciSendString("save recsound sb","", 0, 0);
but its not geting recorded..
Kindly Pay attention..
Thanks in advance..
to record & save.
[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);
private void btnrec_Click(object sender, EventArgs e)
{
mciSendString("open new Type waveaudio Alias recsound", null, 0,0);
mciSendString("record recsound","", 0, 0);
}
private void btnsave_Click(object sender, EventArgs e)
{
mciSendString("save recsound C://recordnew.wav","", 0, 0);
mciSendString("close recsound ","", 0, 0);
Computer c = new Computer();
timer1.Stop();
c.Audio.Stop();
}
I Tried to append via stringBuilder as
StringBuilder sb = new StringBuilder();
sb.Append("C://recordnew.wav");
mciSendString("save recsound sb","", 0, 0);
but its not geting recorded..
Kindly Pay attention..
Thanks in advance..